aboutsummaryrefslogtreecommitdiffhomepage
path: root/expectations/gm/Test-ChromeOS-Link-HD4000-x86_64-Release
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-18 14:19:19 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-18 14:19:19 +0000
commit6ee68583f8b2f7b5bec388d6c454b91d5a9d34a8 (patch)
tree430230ae4dd97baa5994c103af2f716be5c70f09 /expectations/gm/Test-ChromeOS-Link-HD4000-x86_64-Release
parentf84ad8f7fc0194389a8099da2c5e8fff9f092890 (diff)
SkThreadPool: allow for Runnables that add other Runnables to the pool.
There's a scenario that we're currently not allowing for, but I'd really like to use in DM: 1) client calls add(SomeRunnable*) several times 2) client calls wait() 3) any of the runnables added by the client _themselves_ call add(SomeOtherRunnable*) 4-inf) maybe those SomeOtherRunnables too call add(SomeCrazyThirdRunnable*), etc. Right now in this scenario we'll assert in debug mode in step 3) when we call add() and we're waiting to stop, and do strange unspecified things in release mode. The old threadpool had basically two states: running, and waiting to stop. If a thread saw we were waiting to stop and the queue was empty, that thread shut down. This wasn't accounting for any work that other threads might be doing; potentially they were about to add to the queue. So now we have three states: running, waiting, and halting. When the client calls wait() (or the destructor triggers), we move into waiting. When a thread notices we're _really_ done, that is, have an empty queue and there are no active threads, we move into halting. The halting state actually triggers the threads to stop, which wait() is patiently join()ing on. BUG= R=bungeman@google.com, bsalomon@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/26389005 git-svn-id: http://skia.googlecode.com/svn/trunk@11852 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'expectations/gm/Test-ChromeOS-Link-HD4000-x86_64-Release')
0 files changed, 0 insertions, 0 deletions