From e3e8a0fb1bc0700ddf3887358b4414ef26405abf Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 7 Dec 2004 16:16:09 +0000 Subject: [PATCH] STABLE14-pthread-event-names-20041207 pullup change for debugging purposes. --- src/WINNT/pthread/pthread.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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; -- 2.39.5