Skip to content

Commit

Permalink
lockstep_scheduler: check if mutex is still valid
Browse files Browse the repository at this point in the history
It turns out that we can fix the unit tests of the lockstep_scheduler
just by checking if `passed_lock` is not `nullptr`.

Without this check, the unit tests segfaulted.
  • Loading branch information
julianoes authored and bkueng committed Mar 15, 2019
1 parent 2ebb9d2 commit b54ca67
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class LockstepScheduler
// This destructor gets called as part of thread-local storage cleanup.
// This is really only a work-around for non-proper thread stopping. Note that we also assume,
// that we can still access the mutex.
pthread_mutex_unlock(passed_lock);
if (passed_lock) {
pthread_mutex_unlock(passed_lock);
}

done = true;
}

Expand Down

0 comments on commit b54ca67

Please sign in to comment.