Skip to content

Commit 452bdbd

Browse files
committed
update signal
1 parent 7a03a96 commit 452bdbd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

1.14/signal_based_preemption.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,21 @@ asyncPreempt 是汇编实现的,分为三个部分:
380380
└─────────────────────────────────────────────────────────────────────┘ └──────────────────────────────────────────────────────────────────┘
381381
```
382382

383+
## asyncPreempt2
384+
385+
```go
386+
func asyncPreempt2() {
387+
gp := getg()
388+
gp.asyncSafePoint = true
389+
if gp.preemptStop {
390+
mcall(preemptPark)
391+
} else {
392+
mcall(gopreempt_m)
393+
}
394+
gp.asyncSafePoint = false
395+
}
396+
```
397+
383398
## 总结
384399

385400
TODO,总览图

0 commit comments

Comments
 (0)