version 1.10, 2007/08/02 08:06:53
|
version 1.10.2.1, 2007/09/11 16:32:43
|
|
|
// | // |
//============================================================================== | //============================================================================== |
| |
#if defined(PEGASUS_HAVE_PTHREADS) |
#if defined(PEGASUS_HAVE_PTHREADS) && defined(PEGASUS_HAVE_RECURSIVE_MUTEXES) |
typedef pthread_mutex_t MutexType; | typedef pthread_mutex_t MutexType; |
inline void mutex_lock(MutexType* mutex) { pthread_mutex_lock(mutex); } | inline void mutex_lock(MutexType* mutex) { pthread_mutex_lock(mutex); } |
inline void mutex_unlock(MutexType* mutex) { pthread_mutex_unlock(mutex); } | inline void mutex_unlock(MutexType* mutex) { pthread_mutex_unlock(mutex); } |
|
|
# define PEGASUS_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER | # define PEGASUS_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER |
#endif | #endif |
| |
|
#if defined(PEGASUS_HAVE_PTHREADS) && !defined(PEGASUS_HAVE_RECURSIVE_MUTEXES) |
|
typedef pthread_mutex_t MutexType; |
|
inline void mutex_lock(MutexType* mutex) { pthread_mutex_lock(mutex); } |
|
inline void mutex_unlock(MutexType* mutex) { pthread_mutex_unlock(mutex); } |
|
struct MutexRep |
|
{ |
|
pthread_mutex_t mutex; |
|
pthread_cond_t cond; |
|
pthread_t owner; |
|
int count; |
|
}; |
|
# define PEGASUS_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER |
|
#endif |
|
|
#if defined(PEGASUS_HAVE_WINDOWS_THREADS) | #if defined(PEGASUS_HAVE_WINDOWS_THREADS) |
typedef HANDLE MutexType; | typedef HANDLE MutexType; |
inline void mutex_lock(MutexType* m) { WaitForSingleObject(*m, INFINITE); } | inline void mutex_lock(MutexType* m) { WaitForSingleObject(*m, INFINITE); } |
|
|
| |
#if !defined(PEGASUS_HAVE_PTHREADS) || \ | #if !defined(PEGASUS_HAVE_PTHREADS) || \ |
(defined(PEGASUS_OS_ZOS) && (__TARGET_LIB__ < 0x41090000)) || \ | (defined(PEGASUS_OS_ZOS) && (__TARGET_LIB__ < 0x41090000)) || \ |
defined(PEGASUS_OS_VMS) |
defined(PEGASUS_OS_VMS) || \ |
|
defined(PEGASUS_OS_VXWORKS) |
| |
# define PEGASUS_FORK_SAFE_MUTEX(mutex) | # define PEGASUS_FORK_SAFE_MUTEX(mutex) |
| |