Bug 1195767 - part 5 - use signaling instead of broadcast when work items are placed in nsEventQueue; r=gerald

There's no reason to wake up all the threads in a thread pool when one
item gets placed in the queue.  Waking up one will serve the same
purpose and is significantly more efficient for thread pools with large
numbers of threads.
This commit is contained in:
Nathan Froyd 2015-09-03 16:38:18 -04:00
parent 28214d181e
commit 9c2985603c

View File

@ -132,7 +132,7 @@ nsEventQueueBase<MonitorType>::PutEvent(
queueLocation = aRunnable.take();
++mOffsetTail;
LOG(("EVENTQ(%p): notify\n", this));
aProofOfLock.NotifyAll();
aProofOfLock.Notify();
}
template void nsEventQueueBase<Monitor>::PutEvent(already_AddRefed<nsIRunnable>&& aRunnable,