File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
unified-runtime/source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -630,11 +630,12 @@ ur_result_t urQueueRelease(
630
630
UR_CALL (Queue->synchronize ());
631
631
632
632
// Cleanup the allocations from 'AsyncPool' made by this queue.
633
-
634
633
Queue->Context ->AsyncPool .cleanupPoolsForQueue (Queue);
634
+ std::shared_lock<ur_shared_mutex> ContextLock (Queue->Context ->Mutex );
635
635
for (auto &Pool : Queue->Context ->UsmPoolHandles ) {
636
636
Pool->cleanupPoolsForQueue (Queue);
637
637
}
638
+ ContextLock.unlock ();
638
639
639
640
// Destroy all the fences created associated with this queue.
640
641
for (auto it = Queue->CommandListMap .begin ();
@@ -913,9 +914,11 @@ ur_result_t urQueueFinish(
913
914
}
914
915
915
916
Queue->Context ->AsyncPool .cleanupPoolsForQueue (Queue);
917
+ std::shared_lock<ur_shared_mutex> ContextLock (Queue->Context ->Mutex );
916
918
for (auto &Pool : Queue->Context ->UsmPoolHandles ) {
917
919
Pool->cleanupPoolsForQueue (Queue);
918
920
}
921
+ ContextLock.unlock ();
919
922
920
923
return UR_RESULT_SUCCESS;
921
924
}
You can’t perform that action at this time.
0 commit comments