| 68 | } |
| 69 | |
| 70 | void WorkQueue::addWorkItem(osg::ref_ptr<WorkItem> item, bool front) |
| 71 | { |
| 72 | if (item->isDone()) |
| 73 | { |
| 74 | Log(Debug::Error) << "Error: trying to add a work item that is already completed"; |
| 75 | return; |
| 76 | } |
| 77 | |
| 78 | std::unique_lock<std::mutex> lock(mMutex); |
| 79 | if (front) |
| 80 | mQueue.push_front(std::move(item)); |
| 81 | else |
| 82 | mQueue.push_back(std::move(item)); |
| 83 | mCondition.notify_one(); |
| 84 | } |
| 85 | |
| 86 | osg::ref_ptr<WorkItem> WorkQueue::removeWorkItem() |
| 87 | { |
no test coverage detected