aboutsummaryrefslogtreecommitdiff
path: root/mutex.h
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-07-22 23:11:54 -0400
committerTest_User <hax@andrewyu.org>2024-07-22 23:11:54 -0400
commit74ebc09736f85fb72a5bcdc96b93ae50cf86652d (patch)
treeb4d3811cd565d64053b6baff2adcde17812e73bb /mutex.h
parente859880db83c5120670b87c1d5a8cf03eedc1806 (diff)
downloadhaxircd-74ebc09736f85fb72a5bcdc96b93ae50cf86652d.tar.gz
haxircd-74ebc09736f85fb72a5bcdc96b93ae50cf86652d.zip
Bit of improvement on error handling for networking
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);
}