mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Use PR_NotifyCondVar when only one worker thread needs to wake up, bug 785206. r=sstangl
This commit is contained in:
parent
93f90669cb
commit
965fd4a70b
@ -202,6 +202,13 @@ WorkerThreadState::wait(CondVar which, uint32_t millis)
|
||||
|
||||
void
|
||||
WorkerThreadState::notify(CondVar which)
|
||||
{
|
||||
JS_ASSERT(isLocked());
|
||||
PR_NotifyCondVar((which == MAIN) ? mainWakeup : helperWakeup);
|
||||
}
|
||||
|
||||
void
|
||||
WorkerThreadState::notifyAll(CondVar which)
|
||||
{
|
||||
JS_ASSERT(isLocked());
|
||||
PR_NotifyAllCondVar((which == MAIN) ? mainWakeup : helperWakeup);
|
||||
@ -218,8 +225,11 @@ WorkerThread::destroy()
|
||||
{
|
||||
AutoLockWorkerThreadState lock(runtime);
|
||||
terminate = true;
|
||||
state.notify(WorkerThreadState::WORKER);
|
||||
|
||||
/* Notify all workers, to ensure that this thread wakes up. */
|
||||
state.notifyAll(WorkerThreadState::WORKER);
|
||||
}
|
||||
|
||||
PR_JoinThread(thread);
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,7 @@ struct WorkerThreadState
|
||||
|
||||
void wait(CondVar which, uint32_t timeoutMillis = 0);
|
||||
void notify(CondVar which);
|
||||
void notifyAll(CondVar which);
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user