]> Git Repo - VerusCoin.git/commit
Fix intermittent hang issue in scheduler_tests
authorWladimir J. van der Laan <[email protected]>
Thu, 21 May 2015 16:57:10 +0000 (18:57 +0200)
committerWladimir J. van der Laan <[email protected]>
Thu, 21 May 2015 17:07:10 +0000 (19:07 +0200)
commitbdcf5dea7c2e7493be7d8fc157e168b77cce7dcc
treed53175023a197c475a2c3d797367867bfde80791
parent0d862c2739b96005fdf0e2a4df347e7291956fc1
Fix intermittent hang issue in scheduler_tests

Don't clear `stopRequested` and `stopWhenEmpty` at the top of
`serviceQueue`, as this results in a race condition: on systems under
heavy load, some of the threads only get scheduled on the CPU when the
other threads have already finished their work. This causes the flags to
be cleared post-hoc and thus those threads to wait forever.

The potential drawback of this change is that the scheduler cannot be
restarted after being stopped (an explicit reset would be needed), but
we don't use this functionality anyway.
src/scheduler.cpp
This page took 0.025502 seconds and 4 git commands to generate.