Skip to content

Commit 459cbef

Browse files
gmilosrokhinip
authored andcommitted
Retry sem_wait on signal interrupts
Signed-off-by: Kim Topley <ktopley@apple.com>
1 parent 3975291 commit 459cbef

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/shims/lock.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ _dispatch_sema4_signal(_dispatch_sema4_t *sema, long count)
193193
void
194194
_dispatch_sema4_wait(_dispatch_sema4_t *sema)
195195
{
196-
int ret = sem_wait(sema);
196+
int ret = 0;
197+
do {
198+
ret = sem_wait(sema);
199+
} while (ret == -1 && errno == EINTR);
197200
DISPATCH_SEMAPHORE_VERIFY_RET(ret);
198201
}
199202

File renamed without changes.

0 commit comments

Comments
 (0)