Skip to content

Commit 2870269

Browse files
committed
[SYCL] Fix hang in Lit tests
Signed-off-by: Alexander Flegontov <[email protected]>
1 parent 301a0f1 commit 2870269

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sycl/source/detail/scheduler/commands.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,10 @@ class DispatchHostTask {
209209
// process. Thus we'll copy deps prior to completing of event and unblocking
210210
// of empty command.
211211
// Also, it's possible to have record deallocated prior to enqueue process.
212+
// Thus we employ read-lock of graph.
212213
{
213214
Scheduler &Sched = Scheduler::getInstance();
214-
std::unique_lock<std::shared_timed_mutex> Lock(Sched.MGraphLock,
215-
std::defer_lock);
216-
Sched.lockSharedTimedMutex(Lock);
215+
std::shared_lock<std::shared_timed_mutex> Lock(Sched.MGraphLock);
217216

218217
std::vector<DepDesc> Deps = MThisCmd->MDeps;
219218

sycl/source/detail/scheduler/scheduler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ std::vector<EventImplPtr> Scheduler::getWaitList(EventImplPtr Event) {
133133
}
134134

135135
void Scheduler::waitForEvent(EventImplPtr Event) {
136-
std::unique_lock<std::shared_timed_mutex> Lock(MGraphLock, std::defer_lock);
137-
lockSharedTimedMutex(Lock);
136+
std::shared_lock<std::shared_timed_mutex> Lock(MGraphLock);
138137
GraphProcessor::waitForEvent(std::move(Event));
139138
}
140139

0 commit comments

Comments
 (0)