From 0c52f203c09f5deef548c1b2811cbaf28fac981e Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Mon, 15 Jan 2007 13:34:33 +0000 Subject: [PATCH] (struct loc_Thread_t, struct loc_Sem_t, hThreadStartEvent) (loc_RunThisThread, empth_init, empth_create, empth_wait_for_signal) [EMPTH_W32]: Remove some incorrect references to semaphones in the comments. No functional changes. --- src/lib/empthread/ntthread.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index d87117cb..eb002b2e 100644 --- a/src/lib/empthread/ntthread.c +++ b/src/lib/empthread/ntthread.c @@ -41,7 +41,7 @@ * * WIN32 has a full pre-emptive threading environment. But Empire can * not handle pre-emptive threading. Thus, we will use the threads, - * but limit the preemption using a Mutex semaphore. + * but limit the preemption using a Mutex. */ #include @@ -87,7 +87,7 @@ struct loc_Thread_t { /* The system thread ID. */ unsigned long ulThreadID; - /* An Event sem that the thread will wait/sleep on. */ + /* An Mutex that the thread will wait/sleep on. */ HANDLE hThreadEvent; }; @@ -101,7 +101,7 @@ struct loc_Sem_t { /* An exclusion semaphore for this sem. */ HANDLE hMutex; - /* An Event sem that the thread(s) will sleep on. */ + /* An Event that the thread(s) will sleep on. */ HANDLE hEvent; /* The count variable */ @@ -160,7 +160,7 @@ struct loc_RWLock_t { /* either blocked on it, or waiting for some OS response. */ static HANDLE hThreadMutex; -/* This is the thread startup event sem. */ +/* This is the thread startup event. */ /* We use this to lockstep when we are starting up threads. */ static HANDLE hThreadStartEvent; @@ -246,7 +246,7 @@ loc_FreeThreadInfo(empth_t *pThread) * * This thread wants to run. * When this function returns, the globals are set to this thread - * info, and the thread owns the MUTEX sem. + * info, and the thread owns the MUTEX. */ static void loc_RunThisThread(HANDLE hWaitObject) @@ -385,7 +385,7 @@ empth_init(void **ctx_ptr, int flags) global_flags = flags; dwTLSIndex = TlsAlloc(); - /* Create the thread mutex sem. */ + /* Create the thread mutex. */ /* Initally unowned. */ hThreadMutex = CreateMutex(NULL, FALSE, NULL); if (!hThreadMutex) { @@ -393,7 +393,7 @@ empth_init(void **ctx_ptr, int flags) return 0; } - /* Create the thread start event sem. */ + /* Create the thread start event. */ /* Automatic state reset. */ hThreadStartEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (!hThreadStartEvent) { @@ -472,7 +472,7 @@ empth_create(int prio, void (*entry)(void *), int size, int flags, pThread->pfnEntry = entry; pThread->bMainThread = FALSE; - /* Create thread event sem, auto reset. */ + /* Create thread event, auto reset. */ pThread->hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (size < loc_MIN_THREAD_STACK) @@ -642,7 +642,6 @@ empth_wait_for_signal(void) { loc_BlockThisThread(); - /* Get the MUTEX semaphore, wait the number of MS */ WaitForSingleObject(hShutdownEvent, INFINITE); loc_RunThisThread(NULL);