From: Jeffrey Altman Date: Tue, 9 Mar 2004 02:02:38 +0000 (+0000) Subject: event-object-naming-20040308 X-Git-Tag: openafs-devel-1_3_60~58 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5af850b9eefc20b6ae27ca1403917be0dc5294f9;p=packages%2Fo%2Fopenafs.git event-object-naming-20040308 Restore event object naming to the pthread objects. Be sure to identify the objects by PID this time to avoid conflicts. --- diff --git a/src/WINNT/pthread/pthread.c b/src/WINNT/pthread/pthread.c index 4c72ab6c1..33a17a4a0 100644 --- a/src/WINNT/pthread/pthread.c +++ b/src/WINNT/pthread/pthread.c @@ -590,11 +590,14 @@ static void pthread_sync_terminate_thread(void) { (pthread_cache_done || pthread_once(&pthread_cache_once, create_once)); if (terminate_thread_handle == INVALID_HANDLE_VALUE) { - terminate_thread_wakeup_event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, - TRUE, FALSE, (LPCTSTR) 0); - terminate_thread_handle = CreateThread((LPSECURITY_ATTRIBUTES) 0, 0, - terminate_thread_routine, (LPVOID) 0, 0, - &terminate_thread_id); + CHAR eventName[MAX_PATH]; + static eventCount = 0; + sprintf(eventName, "terminate_thread_wakeup_event %d::%d", _getpid(), eventCount++); + terminate_thread_wakeup_event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, + TRUE, FALSE, (LPCTSTR) eventName); + terminate_thread_handle = CreateThread((LPSECURITY_ATTRIBUTES) 0, 0, + terminate_thread_routine, (LPVOID) 0, 0, + &terminate_thread_id); } else { SetEvent (terminate_thread_wakeup_event); } @@ -711,8 +714,11 @@ static cond_waiters_t *get_waiter() { if (queue_IsEmpty(&waiter_cache)) { new = (cond_waiters_t *) malloc(sizeof(cond_waiters_t)); if (new != NULL) { - new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE, - FALSE, (LPCTSTR) 0); + CHAR eventName[MAX_PATH]; + static eventCount = 0; + sprintf(eventName, "cond_waiters_t %d::%d", _getpid(), eventCount++); + new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE, + FALSE, (LPCTSTR) eventName); if (new->event == NULL) { free(new); new = NULL;