You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: add drain() seam to threadHandler interface
Third step of the split suggested in #2287: land the handler-interface
extension point that later handler types (background workers) need,
without introducing any new behaviour.
Each handler gains a drain() method, called by drainWorkerThreads
right before drainChan is closed. All current implementations
(regularThread, workerThread, inactiveThread, taskThread) are no-ops,
so observable behaviour is unchanged. A later handler that needs to
wake up a thread parked in a blocking C call (e.g. by closing a stop
pipe) plugs its signal in here without modifying drainWorkerThreads
again.
- phpthread.go: interface gains drain().
- threadregular.go / threadworker.go / threadinactive.go /
threadtasks_test.go: empty drain() on each handler.
- worker.go: drainWorkerThreads calls thread.handler.drain() right
before close(thread.drainChan).
Full test suite and caddy module tests pass under -race.
0 commit comments