ICU-3156 u_setMutexFunctions(), cleanup to mutex implementation

X-SVN-Rev: 13963
This commit is contained in:
George Rhoten 2003-12-03 06:12:57 +00:00
parent 85312b5541
commit c1c099d85d
3 changed files with 0 additions and 95 deletions
icu4c/source/test/intltest

View File

@ -318,12 +318,6 @@
<File
RelativePath=".\tsmthred.h">
</File>
<File
RelativePath=".\tsmutex.cpp">
</File>
<File
RelativePath=".\tsmutex.h">
</File>
<File
RelativePath=".\tsputil.cpp">
</File>

View File

@ -1,47 +0,0 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2001, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#include "tsmutex.h"
#include <stdio.h>
#include <string.h>
#ifdef U_SOLARIS
#include <signal.h>
#endif
//////////////////////////
//
// Simple Mutex structure
// Increments lockCount each time the mutex is locked.
// Decrements lockCount each time the mutex is unlocked.
//Note: This test does not actually create locks, since
//that would be platform specific. This test simply tests
//the functionality of the Mutex class.
//
//////////////////////////
#if 0
struct MyMutexImp {
MyMutexImp();
uint32_t lockCount;
};
MyMutexImp::MyMutexImp() {
lockCount = 0;
}
static void _myLock(MutexPointer p) {
MyMutexImp* imp = (MyMutexImp*)p;
(imp->lockCount)++;
}
static void _myUnlock(MutexPointer p) {
MyMutexImp* imp = (MyMutexImp*)p;
(imp->lockCount)--;
}
#endif

View File

@ -1,42 +0,0 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2001, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#ifndef MUTEXTEST_H
#define MUTEXTEST_H
#include "intltest.h"
#include "mutex.h"
/**
* Tests Mutex and MutexImplementation functionality using
* a custom MutexImplementation test class, simulating the behaviour
* of an actual mutex
**/
class MutexTest: public IntlTest {
public:
MutexTest();
virtual ~MutexTest();
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
/**
* test the Mutex functionality and API using subroutine TestLock
**/
void TestMutex(void);
/**
* subroutine for TestMutex
**/
void TestLock(void);
/* Was the global mutex initialized. */
static UBool gMutexInitialized;
private:
};
#endif