Skip to content

Commit 3da984d

Browse files
committed
requires a safe state on change.
1 parent 7762da5 commit 3da984d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

phpthread.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ func (thread *phpThread) boot() {
6868
// reboot exits the C thread loop for full ZTS cleanup, then spawns a fresh C thread.
6969
// Returns false if the thread is no longer in Ready state (e.g. shutting down).
7070
func (thread *phpThread) reboot() bool {
71-
if !thread.state.CompareAndSwap(state.Ready, state.Rebooting) {
71+
if !thread.state.RequestSafeStateChange(state.Rebooting) {
72+
// thread already shutting down or done
7273
return false
7374
}
7475

0 commit comments

Comments
 (0)