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).
()
| 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). |
| 83 | func (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 |
| 100 | func (thread *phpThread) shutdown() { |
no test coverage detected