X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Flinux-os.c;h=fbc888e5579a9806d7c13bbeb34fe5d15df29e15;hb=60ce532301c8f4b7ed289d049717ee16639bc4d4;hp=8b6972cc26bef71bcfaa17b9c5f3afa4a89f9f92;hpb=b8228f3fa55a867c3c3f826552fdf8ec6227d275;p=sbcl.git diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c index 8b6972c..fbc888e 100644 --- a/src/runtime/linux-os.c +++ b/src/runtime/linux-os.c @@ -84,7 +84,18 @@ static inline int sys_futex (void *futex, int op, int val, struct timespec *rel) int futex_wait(int *lock_word, int oldval) { - int t= sys_futex(lock_word,FUTEX_WAIT,oldval, 0); + int t; + again: + t = sys_futex(lock_word,FUTEX_WAIT,oldval, 0); + + /* Interrupted FUTEX_WAIT calls may return early. + * + * If someone manages to wake the futex while we're spinning + * around it, we will just return with -1 and errno EWOULDBLOCK, + * because the value has changed, so that's ok. */ + if (t != 0 && errno == EINTR) + goto again; + return t; }