From bd31548903e42b8be11ef34cb3e8579c5e1c889d Mon Sep 17 00:00:00 2001 From: Unbit Date: Thu, 7 Mar 2013 13:17:46 +0100 Subject: [PATCH] re-try semop() on interrupt --- core/lock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/lock.c b/core/lock.c index 7af57147..487a189b 100644 --- a/core/lock.c +++ b/core/lock.c @@ -478,7 +478,9 @@ void uwsgi_lock_ipcsem(struct uwsgi_lock_item *uli) { memcpy(&semid, uli->lock_ptr, sizeof(int)); +retry: if (semop(semid, &sb, 1)) { + if (errno == EINTR) goto retry; uwsgi_error("semop()"); } } @@ -493,7 +495,9 @@ void uwsgi_unlock_ipcsem(struct uwsgi_lock_item *uli) { memcpy(&semid, uli->lock_ptr, sizeof(int)); +retry: if (semop(semid, &sb, 1)) { + if (errno == EINTR) goto retry; uwsgi_error("semop()"); }