Skip to content
Snippets Groups Projects

evshed: don't unlock heap-lock on callback call to prevent race

Merged Libor Peltan requested to merge evshed_nounlock into master
Compare and
1 file
+ 0
2
Preferences
Compare changes
+ 0
2
@@ -85,9 +85,7 @@ static int evsched_run(dthread_t *thread)
if (timercmp_ge(&dt, &ev->tv)) {
heap_delmin(&sched->heap);
pthread_mutex_unlock(&sched->heap_lock);
ev->cb(ev);
pthread_mutex_lock(&sched->heap_lock);
} else {
/* Wait for next event or interrupt. Unlock calendar. */
struct timespec ts;