aboutsummaryrefslogtreecommitdiff
path: root/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'mutex.h')
-rw-r--r--mutex.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/mutex.h b/mutex.h
index df81f54..651f0da 100644
--- a/mutex.h
+++ b/mutex.h
@@ -98,7 +98,7 @@ inline void mutex_lock(sem_t *mutex) {
}
inline void mutex_unlock(sem_t *mutex) {
- sem_trywait(mutex);
+ while (sem_trywait(mutex) == -1 && errno == EINTR);
sem_post(mutex);
}