Skip to content

Commit ac71eb7

Browse files
fix: Avoiding races when modifying queue and Tag data
Related-To: NEO-8196 Signed-off-by: Andrzej Koska <[email protected]> Source: c4a24d8
1 parent 6e21a83 commit ac71eb7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

opencl/source/command_queue/command_queue_hw_base.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ bool CommandQueueHw<Family>::waitForTimestamps(Range<CopyEngineState> copyEngine
172172
bool waited = false;
173173

174174
if (isWaitForTimestampsEnabled()) {
175+
TakeOwnershipWrapper<CommandQueue> queueOwnership(*this);
175176
waited = waitForTimestampsWithinContainer<TSPacketType>(mainContainer, getGpgpuCommandStreamReceiver(), status);
176177

177178
if (waited) {

shared/source/utilities/tag_allocator.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ template <typename TagType>
1515
TagAllocator<TagType>::TagAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memMngr, size_t tagCount, size_t tagAlignment,
1616
size_t tagSize, bool doNotReleaseNodes, DeviceBitfield deviceBitfield)
1717
: TagAllocatorBase(rootDeviceIndices, memMngr, tagCount, tagAlignment, tagSize, doNotReleaseNodes, deviceBitfield) {
18+
std::unique_lock<std::mutex> lock(allocatorMutex);
1819

1920
populateFreeTags();
2021
}

0 commit comments

Comments
 (0)