summaryrefslogtreecommitdiff
path: root/libgo/runtime
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-09 06:31:37 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-09 06:31:37 +0000
commit96f6e4db0f1ade1adabc9e90b7bbbc9bb3a01a7c (patch)
treee817c9c77a0af5e57dc8040886b551c24e0e1365 /libgo/runtime
parentb6a61502ca3a80d8119e48e2f788783ad588e59c (diff)
downloadgcc-96f6e4db0f1ade1adabc9e90b7bbbc9bb3a01a7c.tar.gz
PR go/48019
Ignore EINTR in runtime_lock_full. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170810 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/runtime')
-rw-r--r--libgo/runtime/thread.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libgo/runtime/thread.c b/libgo/runtime/thread.c
index b600754f64c..bac3f7dfdc1 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