|
a/src/utils/workqueue.h |
|
b/src/utils/workqueue.h |
|
... |
|
... |
145 |
* done in parallel with the worker's tasks, or before shutting
|
145 |
* done in parallel with the worker's tasks, or before shutting
|
146 |
* down. Work can be resumed after calling this. Note that the
|
146 |
* down. Work can be resumed after calling this. Note that the
|
147 |
* only thread which can call it safely is the client just above
|
147 |
* only thread which can call it safely is the client just above
|
148 |
* (which can control the task flow), else there could be
|
148 |
* (which can control the task flow), else there could be
|
149 |
* tasks in the intermediate queues.
|
149 |
* tasks in the intermediate queues.
|
|
|
150 |
* To rephrase: there is no warranty on return that the queue is actually
|
|
|
151 |
* idle EXCEPT if the caller knows that no jobs are still being created.
|
|
|
152 |
* It would be possible to transform this into a safe call if some kind
|
|
|
153 |
* of suspend condition was set on the queue by waitIdle(), to be reset by
|
|
|
154 |
* some kind of "resume" call. Not currently the case.
|
150 |
*/
|
155 |
*/
|
151 |
bool waitIdle()
|
156 |
bool waitIdle()
|
152 |
{
|
157 |
{
|
153 |
PTMutexLocker lock(m_mutex);
|
158 |
PTMutexLocker lock(m_mutex);
|
154 |
if (!lock.ok() || !ok()) {
|
159 |
if (!lock.ok() || !ok()) {
|