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

Function allPossibleTransitions

phpmainthread_test.go:248–262  ·  view source on GitHub ↗

create a mix of possible transitions of workers and regular threads

(worker1Path string, worker2Path string)

Source from the content-addressed store, hash-verified

246
247// create a mix of possible transitions of workers and regular threads
248func allPossibleTransitions(worker1Path string, worker2Path string) []func(*phpThread) {
249 return []func(*phpThread){
250 convertToRegularThread,
251 func(thread *phpThread) { thread.shutdown() },
252 func(thread *phpThread) {
253 if thread.state.Is(state.Reserved) {
254 thread.boot()
255 }
256 },
257 func(thread *phpThread) { convertToWorkerThread(thread, workersByPath[worker1Path]) },
258 convertToInactiveThread,
259 func(thread *phpThread) { convertToWorkerThread(thread, workersByPath[worker2Path]) },
260 convertToInactiveThread,
261 }
262}
263
264func TestCorrectThreadCalculation(t *testing.T) {
265 maxProcs := runtime.GOMAXPROCS(0) * 2

Calls 4

convertToWorkerThreadFunction · 0.85
shutdownMethod · 0.80
IsMethod · 0.80
bootMethod · 0.80

Tested by

no test coverage detected