MCPcopy Index your code
hub / github.com/php/frankenphp / reboot

Method reboot

phpthread.go:83–97  ·  view source on GitHub ↗

reboot exits the C thread loop for full ZTS cleanup, then spawns a fresh C thread. Returns false if the thread is no longer in Ready state (e.g. shutting down).

()

Source from the content-addressed store, hash-verified

81// reboot exits the C thread loop for full ZTS cleanup, then spawns a fresh C thread.
82// Returns false if the thread is no longer in Ready state (e.g. shutting down).
83func (thread *phpThread) reboot() bool {
84 if !thread.state.CompareAndSwap(state.Ready, state.Rebooting) {
85 return false
86 }
87
88 go func() {
89 thread.state.WaitFor(state.RebootReady)
90
91 if !C.frankenphp_new_php_thread(C.uintptr_t(thread.threadIndex)) {
92 panic("unable to create thread")
93 }
94 }()
95
96 return true
97}
98
99// shutdown the underlying PHP thread
100func (thread *phpThread) shutdown() {

Callers 2

waitForWorkerRequestMethod · 0.80
waitForRequestMethod · 0.80

Calls 2

CompareAndSwapMethod · 0.80
WaitForMethod · 0.80

Tested by

no test coverage detected