diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-03-09 06:31:37 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-03-09 06:31:37 +0000 |
commit | 7b5e671326b7516d1ca13cb64050ffda279e66ea (patch) | |
tree | e817c9c77a0af5e57dc8040886b551c24e0e1365 | |
parent | 8897c836a89381c814407e5d2cc70b813ce70f09 (diff) | |
download | gcc-7b5e671326b7516d1ca13cb64050ffda279e66ea.zip gcc-7b5e671326b7516d1ca13cb64050ffda279e66ea.tar.gz gcc-7b5e671326b7516d1ca13cb64050ffda279e66ea.tar.bz2 |
re PR go/48019 (Need to handle EINTR in libgo testsuite)
PR go/48019
Ignore EINTR in runtime_lock_full.
From-SVN: r170810
-rw-r--r-- | libgo/runtime/thread.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libgo/runtime/thread.c b/libgo/runtime/thread.c index b600754..bac3f7d 100644 --- a/libgo/runtime/thread.c +++ b/libgo/runtime/thread.c @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include <errno.h> #include "runtime.h" #include "go-assert.h" @@ -32,8 +33,12 @@ static void runtime_lock_full(Lock *l) __attribute__ ((noinline)); static void runtime_lock_full(Lock *l) { - if(sem_wait(&l->sem) != 0) - runtime_throw("sem_wait failed"); + for(;;){ + if(sem_wait(&l->sem) == 0) + return; + if(errno != EINTR) + runtime_throw("sem_wait failed"); + } } void |