@@ -189,8 +189,8 @@ void Scheduler::cleanupFinishedCommands(EventImplPtr FinishedEvent) {
189
189
if (FinishedCmd)
190
190
MGraphBuilder.cleanupFinishedCommands (FinishedCmd, StreamsToDeallocate);
191
191
}
192
- deallocateStreams (StreamsToDeallocate);
193
192
}
193
+ deallocateStreams (StreamsToDeallocate);
194
194
}
195
195
196
196
void Scheduler::removeMemoryObject (detail::SYCLMemObjI *MemObj) {
@@ -226,9 +226,9 @@ void Scheduler::removeMemoryObject(detail::SYCLMemObjI *MemObj) {
226
226
MGraphBuilder.decrementLeafCountersForRecord (Record);
227
227
MGraphBuilder.cleanupCommandsForRecord (Record, StreamsToDeallocate);
228
228
MGraphBuilder.removeRecordForMemObj (MemObj);
229
- deallocateStreams (StreamsToDeallocate);
230
229
}
231
230
}
231
+ deallocateStreams (StreamsToDeallocate);
232
232
}
233
233
234
234
EventImplPtr Scheduler::addHostAccessor (Requirement *Req) {
@@ -276,13 +276,13 @@ void Scheduler::enqueueLeavesOfReqUnlocked(const Requirement *const Req) {
276
276
void Scheduler::allocateStreamBuffers (stream_impl *Impl,
277
277
size_t StreamBufferSize,
278
278
size_t FlushBufferSize) {
279
- std::lock_guard<std::mutex > lock (StreamBuffersPoolMutex);
279
+ std::lock_guard<std::recursive_mutex > lock (StreamBuffersPoolMutex);
280
280
StreamBuffersPool.insert (
281
281
{Impl, new StreamBuffers (StreamBufferSize, FlushBufferSize)});
282
282
}
283
283
284
284
void Scheduler::deallocateStreamBuffers (stream_impl *Impl) {
285
- std::lock_guard<std::mutex > lock (StreamBuffersPoolMutex);
285
+ std::lock_guard<std::recursive_mutex > lock (StreamBuffersPoolMutex);
286
286
delete StreamBuffersPool[Impl];
287
287
StreamBuffersPool.erase (Impl);
288
288
}
@@ -302,7 +302,7 @@ Scheduler::~Scheduler() {
302
302
// the kernel. Otherwise resources for stream will not be released, issue a
303
303
// warning in this case.
304
304
if (pi::trace (pi::TraceLevel::PI_TRACE_BASIC)) {
305
- std::lock_guard<std::mutex > lock (StreamBuffersPoolMutex);
305
+ std::lock_guard<std::recursive_mutex > lock (StreamBuffersPoolMutex);
306
306
if (!StreamBuffersPool.empty ())
307
307
fprintf (
308
308
stderr,
0 commit comments