version 1.7, 2006/11/10 18:14:58
|
version 1.8, 2007/01/02 19:41:23
|
|
|
static void semaphore_cleanup(void *arg) | static void semaphore_cleanup(void *arg) |
{ | { |
// cast back to proper type and unlock mutex | // cast back to proper type and unlock mutex |
PEGASUS_SEM_HANDLE *s = (PEGASUS_SEM_HANDLE *) arg; |
SemaphoreRep *s = (SemaphoreRep *) arg; |
pthread_mutex_unlock(&s->mutex); | pthread_mutex_unlock(&s->mutex); |
} | } |
#endif | #endif |
|
|
#if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) | #if 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); |
Threads::cleanup_push(&semaphore_cleanup, &_rep); |
#endif | #endif |
| |
// Keep track of the number of waiters so that <sema_post> works correctly. | // Keep track of the number of waiters so that <sema_post> works correctly. |