| 73 | } |
| 74 | |
| 75 | void erase(JobItem* jobItem) |
| 76 | { |
| 77 | cond->lock(); |
| 78 | SKR_ASSERT(jobItem); |
| 79 | SKR_ASSERT(jobItem->status != kJobItemStatusNone); |
| 80 | |
| 81 | bool isFound = false; |
| 82 | for (auto i = list_consumed.begin(); i != list_consumed.end(); ++i) |
| 83 | { |
| 84 | if ((*i) == jobItem) |
| 85 | { |
| 86 | // update the status of JobItem together with the state of the queue |
| 87 | list_consumed.erase(i); |
| 88 | skr_atomic32_store_release(&jobItem->status, kJobItemStatusNone); |
| 89 | isFound = true; |
| 90 | break; |
| 91 | } |
| 92 | } |
| 93 | SKR_ASSERT(isFound); |
| 94 | |
| 95 | cond->unlock(); |
| 96 | } |
| 97 | |
| 98 | JobItem* getRunnableJobItem() |
| 99 | { |
no test coverage detected