We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49d7380 commit 82d6696Copy full SHA for 82d6696
1 file changed
phpthread.go
@@ -66,9 +66,11 @@ func (thread *phpThread) boot() {
66
// shutdown the underlying PHP thread
67
func (thread *phpThread) shutdown() {
68
if !thread.state.RequestSafeStateChange(state.ShuttingDown) {
69
- // already shutting down or done
+ // already shutting down or done, wait for the C thread to finish
70
+ thread.state.WaitFor(state.Done, state.Reserved)
71
return
72
}
73
+
74
close(thread.drainChan)
75
thread.state.WaitFor(state.Done)
76
thread.drainChan = make(chan struct{})
0 commit comments