Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ class Scheduler : public GlobAlloc, public Callee {
futex_lock(&schedLock);
}

// jz: wake up sleeping threads to avoid deadlock
if (th->state == SLEEPING) {
sleepQueue.remove(th);
th->state = BLOCKED;
}

//dsm: Added this check; the normal sequence is leave, finish, but with fastFwd you never know
if (th->state == RUNNING) {
warn("RUNNING thread %d (cid %d) called finish(), trying leave() first", tid, th->cid);
Expand Down