File tree 2 files changed +8
-5
lines changed 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1293,7 +1293,7 @@ func mstart1() {
1293
1293
//go:yeswritebarrierrec
1294
1294
func mstartm0 () {
1295
1295
// Create an extra M for callbacks on threads not created by Go.
1296
- if iscgo && ! cgoHasExtraM {
1296
+ if ( iscgo || GOOS == "windows" ) && ! cgoHasExtraM {
1297
1297
cgoHasExtraM = true
1298
1298
newextram ()
1299
1299
}
@@ -1618,7 +1618,7 @@ func allocm(_p_ *p, fn func()) *m {
1618
1618
// put the m back on the list.
1619
1619
//go:nosplit
1620
1620
func needm (x byte ) {
1621
- if iscgo && ! cgoHasExtraM {
1621
+ if ( iscgo || GOOS == "windows" ) && ! cgoHasExtraM {
1622
1622
// Can happen if C/C++ code calls Go from a global ctor.
1623
1623
// Can not throw, because scheduler is not initialized yet.
1624
1624
write (2 , unsafe .Pointer (& earlycgocallback [0 ]), int32 (len (earlycgocallback )))
@@ -4215,8 +4215,13 @@ func checkdead() {
4215
4215
return
4216
4216
}
4217
4217
4218
+ var run0 int32
4219
+ if ! iscgo && cgoHasExtraM {
4220
+ run0 = 1
4221
+ }
4222
+
4218
4223
run := mcount () - sched .nmidle - sched .nmidlelocked - sched .nmsys
4219
- if run > 0 {
4224
+ if run > run0 {
4220
4225
return
4221
4226
}
4222
4227
if run < 0 {
Original file line number Diff line number Diff line change @@ -251,8 +251,6 @@ func TestBlockingCallback(t *testing.T) {
251
251
}
252
252
253
253
func TestCallbackInAnotherThread (t * testing.T ) {
254
- t .Skip ("Skipping failing test (see golang.org/issue/6751 for details)" )
255
-
256
254
d := GetDLL (t , "kernel32.dll" )
257
255
258
256
f := func (p uintptr ) uintptr {
You can’t perform that action at this time.
0 commit comments