| 27 | } |
| 28 | |
| 29 | void TaskQueue::dispose() { |
| 30 | if (!_disposed) { |
| 31 | _disposed = true; |
| 32 | std::deque<Task> toDelete; |
| 33 | _mutex.lock(); |
| 34 | toDelete.swap(_tasks); |
| 35 | _mutex.unlock(); |
| 36 | _condition.notifyAll(); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | void TaskQueue::sync(const DispatchFunction& function) { |
| 41 | barrier(function); |