| 158 | bool IsValid() const { return !this->ThreadPool.empty(); } |
| 159 | |
| 160 | void PushBack(vtkWork&& work) |
| 161 | { |
| 162 | if (!this->IsValid()) |
| 163 | { |
| 164 | vtkLogF(ERROR, "Queue is invalid! Can't push work!"); |
| 165 | return; |
| 166 | } |
| 167 | |
| 168 | auto key = work.Key; |
| 169 | work.TimeStamp = ++this->LastTimeStamp[key]; |
| 170 | { |
| 171 | std::unique_lock<std::mutex> lock(this->QueueMutex); |
| 172 | this->Queue.emplace(std::move(work)); |
| 173 | } |
| 174 | this->QueueCondition.notify_one(); |
| 175 | } |
| 176 | |
| 177 | bool GetResult(vtkTypeUInt32 key, vtkSmartPointer<vtkUnsignedCharArray>& data) const |
| 178 | { |
no test coverage detected