aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/cgocall.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/cgocall.go')
-rw-r--r--src/runtime/cgocall.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go
index d7e20ebc1d..f8d693060d 100644
--- a/src/runtime/cgocall.go
+++ b/src/runtime/cgocall.go
@@ -80,6 +80,7 @@
package runtime
import (
+ "runtime/internal/atomic"
"runtime/internal/sys"
"unsafe"
)
@@ -176,7 +177,7 @@ func cgocallbackg(ctxt uintptr) {
func cgocallbackg1(ctxt uintptr) {
gp := getg()
- if gp.m.needextram {
+ if gp.m.needextram || atomic.Load(&extraMWaiters) > 0 {
gp.m.needextram = false
systemstack(newextram)
}