aboutsummaryrefslogtreecommitdiff
path: root/src/scheduler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace boost::reverse_lock with our own.Casey Rodarmor2015-09-031-2/+3
|
* Make sure we re-acquire lock if a task throwsCasey Rodarmor2015-08-181-5/+7
|
* Fix scheduler build with some boost versions.Cory Fields2015-06-151-1/+3
| | | | | Some boost versions have a conflicting overload of wait_until that returns void. Explicitly use a template here to avoid hitting that overload.
* Fix intermittent hang issue in scheduler_testsWladimir J. van der Laan2015-05-211-2/+0
| | | | | | | | | | | | 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.
* More robust CScheduler unit testGavin Andresen2015-05-161-8/+38
| | | | | | | | | On a busy or slow system, the CScheduler unit test could fail because it assumed all threads would be done after a couple of milliseconds. Replace the hard-coded sleep with CScheduler stop() method that will cleanly exit the servicing threads when all tasks are completely finished.
* scheduler: fix with boost <= 1.50Cory Fields2015-05-141-5/+1
|
* CScheduler class for lightweight task schedulingGavin Andresen2015-05-141-0/+102
Simple class to manage a task queue that is serviced by one or more threads.