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

Method WaitFor

internal/state/state.go:154–169  ·  view source on GitHub ↗

WaitFor blocks until the thread reaches a certain state

(states ...State)

Source from the content-addressed store, hash-verified

152
153// WaitFor blocks until the thread reaches a certain state
154func (ts *ThreadState) WaitFor(states ...State) {
155 ts.mu.Lock()
156 if slices.Contains(states, ts.currentState) {
157 ts.mu.Unlock()
158
159 return
160 }
161
162 sub := stateSubscriber{
163 states: states,
164 ch: make(chan struct{}),
165 }
166 ts.subscribers = append(ts.subscribers, sub)
167 ts.mu.Unlock()
168 <-sub.ch
169}
170
171// RequestSafeStateChange safely requests a state change from a different goroutine
172func (ts *ThreadState) RequestSafeStateChange(nextState State) bool {

Callers 15

bootMethod · 0.80
rebootMethod · 0.80
shutdownMethod · 0.80
setHandlerMethod · 0.80
drainPHPThreadsFunction · 0.80
startMethod · 0.80
beforeScriptExecutionMethod · 0.80

Calls

no outgoing calls