| 511 | } |
| 512 | |
| 513 | inline |
| 514 | bool TaskQueue::isInterrupted() |
| 515 | { |
| 516 | if (_isEmpty && _isSharedQueueEmpty) |
| 517 | { |
| 518 | std::unique_lock<std::mutex> lock(_notEmptyMutex); |
| 519 | //========================= BLOCK WHEN EMPTY ========================= |
| 520 | //Wait for the queue to have at least one element |
| 521 | _notEmptyCond.wait(lock, [this]()->bool { return !_isEmpty || !_isSharedQueueEmpty || _isInterrupted; }); |
| 522 | } |
| 523 | return _isInterrupted; |
| 524 | } |
| 525 | |
| 526 | inline |
| 527 | TaskQueue::WorkItem |