File tree Expand file tree Collapse file tree
unified-runtime/source/adapters/level_zero Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -630,11 +630,12 @@ ur_result_t urQueueRelease(
630630 UR_CALL (Queue->synchronize ());
631631
632632 // Cleanup the allocations from 'AsyncPool' made by this queue.
633-
634633 Queue->Context ->AsyncPool .cleanupPoolsForQueue (Queue);
634+ std::shared_lock<ur_shared_mutex> ContextLock (Queue->Context ->Mutex );
635635 for (auto &Pool : Queue->Context ->UsmPoolHandles ) {
636636 Pool->cleanupPoolsForQueue (Queue);
637637 }
638+ ContextLock.unlock ();
638639
639640 // Destroy all the fences created associated with this queue.
640641 for (auto it = Queue->CommandListMap .begin ();
@@ -913,9 +914,11 @@ ur_result_t urQueueFinish(
913914 }
914915
915916 Queue->Context ->AsyncPool .cleanupPoolsForQueue (Queue);
917+ std::shared_lock<ur_shared_mutex> ContextLock (Queue->Context ->Mutex );
916918 for (auto &Pool : Queue->Context ->UsmPoolHandles ) {
917919 Pool->cleanupPoolsForQueue (Queue);
918920 }
921+ ContextLock.unlock ();
919922
920923 return UR_RESULT_SUCCESS;
921924}
You can’t perform that action at this time.
0 commit comments