()
| 19 | } |
| 20 | |
| 21 | func (handler *inactiveThread) beforeScriptExecution() string { |
| 22 | thread := handler.thread |
| 23 | |
| 24 | switch thread.state.Get() { |
| 25 | case state.TransitionRequested: |
| 26 | return thread.transitionToNewHandler() |
| 27 | |
| 28 | case state.Booting, state.TransitionComplete: |
| 29 | thread.state.Set(state.Inactive) |
| 30 | |
| 31 | // wait for external signal to start or shut down |
| 32 | thread.state.MarkAsWaiting(true) |
| 33 | thread.state.WaitFor(state.TransitionRequested, state.ShuttingDown) |
| 34 | thread.state.MarkAsWaiting(false) |
| 35 | |
| 36 | return handler.beforeScriptExecution() |
| 37 | |
| 38 | case state.ShuttingDown: |
| 39 | // signal to stop |
| 40 | return "" |
| 41 | } |
| 42 | |
| 43 | panic("unexpected state: " + thread.state.Name()) |
| 44 | } |
| 45 | |
| 46 | func (handler *inactiveThread) afterScriptExecution(int) { |
| 47 | panic("inactive threads should not execute scripts") |
nothing calls this directly
no test coverage detected