version 1.1.2.4, 2006/07/28 21:19:53
|
version 1.1.2.6, 2006/08/02 07:26:35
|
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
static const int PEGASUS_SEM_VALUE_MAX = 0x0000ffff; |
static const Uint32 PEGASUS_SEM_VALUE_MAX = 0x0000ffff; |
| |
//============================================================================== | //============================================================================== |
// | // |
|
|
#endif | #endif |
} | } |
| |
#if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
#if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
// cleanup function | // cleanup function |
static void semaphore_cleanup(void *arg) | static void semaphore_cleanup(void *arg) |
{ | { |
|
|
| |
// Push cleanup function onto cleanup stack | // Push cleanup function onto cleanup stack |
// The mutex will unlock if the thread is killed early | // The mutex will unlock if the thread is killed early |
#if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
#if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
Threads::cleanup_push(&semaphore_cleanup, &_rep); | Threads::cleanup_push(&semaphore_cleanup, &_rep); |
#endif | #endif |
| |
|
|
| |
// Since we push an unlock onto the cleanup stack | // Since we push an unlock onto the cleanup stack |
// We will pop it off to release the mutex when leaving the critical section. | // We will pop it off to release the mutex when leaving the critical section. |
#if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
#if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
Threads::cleanup_pop(1); | Threads::cleanup_pop(1); |
#endif | #endif |
// Release mutex to leave critical section. | // Release mutex to leave critical section. |
|
|
pthread_mutex_lock (&_rep.mutex); | pthread_mutex_lock (&_rep.mutex); |
Boolean timedOut = false; | Boolean timedOut = false; |
| |
#if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || \ |
#if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
|
// Push cleanup function onto cleanup stack | // Push cleanup function onto cleanup stack |
// The mutex will unlock if the thread is killed early | // The mutex will unlock if the thread is killed early |
Thread::cleanup_push(&semaphore_cleanup, &_rep); | Thread::cleanup_push(&semaphore_cleanup, &_rep); |
|
|
// Decrement the waiters count. | // Decrement the waiters count. |
_rep.waiters--; | _rep.waiters--; |
| |
#if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || \ |
#if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) |
|
// Since we push an unlock onto the cleanup stack | // Since we push an unlock onto the cleanup stack |
// We will pop it off to release the mutex when leaving the critical section. | // We will pop it off to release the mutex when leaving the critical section. |
Threads::cleanup_pop(1); | Threads::cleanup_pop(1); |