From 74ebc09736f85fb72a5bcdc96b93ae50cf86652d Mon Sep 17 00:00:00 2001 From: Test_User Date: Mon, 22 Jul 2024 23:11:54 -0400 Subject: Bit of improvement on error handling for networking --- mutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mutex.h') 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); } -- cgit v1.2.3