summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-02 00:47:53 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-02 00:47:53 +0000
commitc68ad2a8934ec88d9dc075fa479cd69f0ff1843d (patch)
tree5a36e29e7fb33bb94de5f242fe097b031bbc1d4c /libgo
parent2c4e1ebf9e928dd52ec78193c7e3786844200b38 (diff)
downloadgcc-c68ad2a8934ec88d9dc075fa479cd69f0ff1843d.tar.gz
runtime: Use atomic load for in entersyscall.
Reportedly fixes PPC64 deadlock. From a comment by Gabriel Russell. Fixes golang/go#15051. Reviewed-on: https://go-review.googlesource.com/21450 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234694 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index 9ba199b8cae..c6ac972bd41 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -2042,7 +2042,7 @@ doentersyscall()
m->mcache = nil;
m->p->m = nil;
runtime_atomicstore(&m->p->status, Psyscall);
- if(runtime_sched.gcwaiting) {
+ if(runtime_atomicload(&runtime_sched.gcwaiting)) {
runtime_lock(&runtime_sched);
if (runtime_sched.stopwait > 0 && runtime_cas(&m->p->status, Psyscall, Pgcstop)) {
if(--runtime_sched.stopwait == 0)