diff --git a/src/LinkedBlockingQueue.c b/src/LinkedBlockingQueue.c index 0b40101..3d96855 100644 --- a/src/LinkedBlockingQueue.c +++ b/src/LinkedBlockingQueue.c @@ -204,7 +204,6 @@ int LbqPollQueueElement(PLINKED_BLOCKING_QUEUE queueHead, void** data) { int LbqWaitForQueueElement(PLINKED_BLOCKING_QUEUE queueHead, void** data) { PLINKED_BLOCKING_QUEUE_ENTRY entry; - int err; if (queueHead->shutdown) { return LBQ_INTERRUPTED; @@ -217,10 +216,7 @@ int LbqWaitForQueueElement(PLINKED_BLOCKING_QUEUE queueHead, void** data) { // // If we're draining, we will never wait on the queue. if (queueHead->head == NULL && !queueHead->draining) { - err = PltWaitForEvent(&queueHead->containsDataEvent); - if (err != PLT_WAIT_SUCCESS) { - return LBQ_INTERRUPTED; - } + PltWaitForEvent(&queueHead->containsDataEvent); } PltLockMutex(&queueHead->mutex); diff --git a/src/Platform.c b/src/Platform.c index 5c8ec00..3cbb2f0 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -329,25 +329,15 @@ void PltClearEvent(PLT_EVENT* event) { #endif } -int PltWaitForEvent(PLT_EVENT* event) { +void PltWaitForEvent(PLT_EVENT* event) { #if defined(LC_WINDOWS) - DWORD error; - - error = WaitForSingleObjectEx(*event, INFINITE, FALSE); - if (error == WAIT_OBJECT_0) { - return PLT_WAIT_SUCCESS; - } - else { - LC_ASSERT(false); - return -1; - } + WaitForSingleObjectEx(*event, INFINITE, FALSE); #else PltLockMutex(&event->mutex); while (!event->signalled) { PltWaitForConditionVariable(&event->cond, &event->mutex); } PltUnlockMutex(&event->mutex); - return PLT_WAIT_SUCCESS; #endif } diff --git a/src/PlatformThreads.h b/src/PlatformThreads.h index 3d05a90..6f37e58 100644 --- a/src/PlatformThreads.h +++ b/src/PlatformThreads.h @@ -64,15 +64,12 @@ int PltCreateEvent(PLT_EVENT* event); void PltCloseEvent(PLT_EVENT* event); void PltSetEvent(PLT_EVENT* event); void PltClearEvent(PLT_EVENT* event); -int PltWaitForEvent(PLT_EVENT* event); +void PltWaitForEvent(PLT_EVENT* event); int PltCreateConditionVariable(PLT_COND* cond, PLT_MUTEX* mutex); void PltDeleteConditionVariable(PLT_COND* cond); void PltSignalConditionVariable(PLT_COND* cond); void PltWaitForConditionVariable(PLT_COND* cond, PLT_MUTEX* mutex); -#define PLT_WAIT_SUCCESS 0 -#define PLT_WAIT_INTERRUPTED 1 - void PltSleepMs(int ms); void PltSleepMsInterruptible(PLT_THREAD* thread, int ms);