OSDN Git Service

Bug 5044578 Fix race in engine destroy on uni
authorGlenn Kasten <gkasten@google.com>
Tue, 19 Jul 2011 00:37:40 +0000 (17:37 -0700)
committerGlenn Kasten <gkasten@google.com>
Tue, 19 Jul 2011 17:28:00 +0000 (10:28 -0700)
commit197ae56e3320896a4cdc879f0b6012463bcbfe9b
treefa43e3beaa7d297c6847e720c8422606e7fbb1be
parent33c8006169faa725ef22fd074b8365c63a300d55
Bug 5044578 Fix race in engine destroy on uni

On uniprocessor, the main thread reached Engine::Destroy before the
worker threads had even started, so they did not see the shutdown.

On SMP, the worker threads were started (and blocked), so it was OK.

This new code also has the advantage of shutting down quicker
if there are pending callback requests in the queue.

Change-Id: Iff8cca042ebffe48ce7cc5d798e7b3b9911fb64b
wilhelm/src/ThreadPool.c