File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1293,7 +1293,7 @@ func mstart1() {
12931293//go:yeswritebarrierrec
12941294func mstartm0 () {
12951295 // Create an extra M for callbacks on threads not created by Go.
1296- if iscgo && ! cgoHasExtraM {
1296+ if ( iscgo || GOOS == "windows" ) && ! cgoHasExtraM {
12971297 cgoHasExtraM = true
12981298 newextram ()
12991299 }
@@ -1618,7 +1618,7 @@ func allocm(_p_ *p, fn func()) *m {
16181618// put the m back on the list.
16191619//go:nosplit
16201620func needm (x byte ) {
1621- if iscgo && ! cgoHasExtraM {
1621+ if ( iscgo || GOOS == "windows" ) && ! cgoHasExtraM {
16221622 // Can happen if C/C++ code calls Go from a global ctor.
16231623 // Can not throw, because scheduler is not initialized yet.
16241624 write (2 , unsafe .Pointer (& earlycgocallback [0 ]), int32 (len (earlycgocallback )))
@@ -4215,8 +4215,13 @@ func checkdead() {
42154215 return
42164216 }
42174217
4218+ var run0 int32
4219+ if ! iscgo && cgoHasExtraM {
4220+ run0 = 1
4221+ }
4222+
42184223 run := mcount () - sched .nmidle - sched .nmidlelocked - sched .nmsys
4219- if run > 0 {
4224+ if run > run0 {
42204225 return
42214226 }
42224227 if run < 0 {
Original file line number Diff line number Diff line change @@ -251,8 +251,6 @@ func TestBlockingCallback(t *testing.T) {
251251}
252252
253253func TestCallbackInAnotherThread (t * testing.T ) {
254- t .Skip ("Skipping failing test (see golang.org/issue/6751 for details)" )
255-
256254 d := GetDLL (t , "kernel32.dll" )
257255
258256 f := func (p uintptr ) uintptr {
You can’t perform that action at this time.
0 commit comments