@@ -336,7 +336,7 @@ func doSigPreempt(gp *g, ctxt *sigctxt) {
336
336
atomic .Xadd (& gp .m .preemptGen , 1 )
337
337
atomic .Store (& gp .m .signalPending , 0 )
338
338
339
- if GOOS == "darwin" {
339
+ if GOOS == "darwin" || GOOS == "ios" {
340
340
atomic .Xadd (& pendingPreemptSignals , - 1 )
341
341
}
342
342
}
@@ -352,12 +352,12 @@ const preemptMSupported = true
352
352
func preemptM (mp * m ) {
353
353
// On Darwin, don't try to preempt threads during exec.
354
354
// Issue #41702.
355
- if GOOS == "darwin" {
355
+ if GOOS == "darwin" || GOOS == "ios" {
356
356
execLock .rlock ()
357
357
}
358
358
359
359
if atomic .Cas (& mp .signalPending , 0 , 1 ) {
360
- if GOOS == "darwin" {
360
+ if GOOS == "darwin" || GOOS == "ios" {
361
361
atomic .Xadd (& pendingPreemptSignals , 1 )
362
362
}
363
363
@@ -369,7 +369,7 @@ func preemptM(mp *m) {
369
369
signalM (mp , sigPreempt )
370
370
}
371
371
372
- if GOOS == "darwin" {
372
+ if GOOS == "darwin" || GOOS == "ios" {
373
373
execLock .runlock ()
374
374
}
375
375
}
@@ -432,7 +432,7 @@ func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
432
432
// no non-Go signal handler for sigPreempt.
433
433
// The default behavior for sigPreempt is to ignore
434
434
// the signal, so badsignal will be a no-op anyway.
435
- if GOOS == "darwin" {
435
+ if GOOS == "darwin" || GOOS == "ios" {
436
436
atomic .Xadd (& pendingPreemptSignals , - 1 )
437
437
}
438
438
return
0 commit comments