We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f252c1c commit e2f3a33Copy full SHA for e2f3a33
SYCL/Plugin/interop-level-zero-thread.cpp
@@ -110,15 +110,19 @@ ze_event_handle_t getEvent() {
110
}
111
112
void worker() {
113
- std::unique_lock<std::mutex> lk(mt);
114
-
115
while (true) {
116
- cv.wait(lk, []() { return ops.size() > 0 || stop_worker; });
117
- if (stop_worker)
118
- return;
119
- auto op = ops.front();
120
- ops.pop_front();
121
+ operation op;
+ {
+
+ std::unique_lock<std::mutex> lk(mt);
+ cv.wait(lk, []() { return ops.size() > 0 || stop_worker; });
+ if (stop_worker)
+ return;
122
123
+ op = ops.front();
124
+ ops.pop_front();
125
+ }
126
for (auto dep : op.deps) {
127
// Wait for dependencies to complete
128
while (dep.get_info<sycl::info::event::command_execution_status>() !=
0 commit comments