()
| 42 | } |
| 43 | |
| 44 | func (handler *taskThread) beforeScriptExecution() string { |
| 45 | thread := handler.thread |
| 46 | |
| 47 | switch thread.state.Get() { |
| 48 | case state.TransitionRequested: |
| 49 | return thread.transitionToNewHandler() |
| 50 | case state.Booting, state.TransitionComplete: |
| 51 | thread.state.Set(state.Ready) |
| 52 | handler.waitForTasks() |
| 53 | |
| 54 | return handler.beforeScriptExecution() |
| 55 | case state.Ready: |
| 56 | handler.waitForTasks() |
| 57 | |
| 58 | return handler.beforeScriptExecution() |
| 59 | case state.ShuttingDown: |
| 60 | // signal to stop |
| 61 | return "" |
| 62 | } |
| 63 | panic("unexpected state: " + thread.state.Name()) |
| 64 | } |
| 65 | |
| 66 | func (handler *taskThread) afterScriptExecution(_ int) { |
| 67 | panic("task threads should not execute scripts") |
nothing calls this directly
no test coverage detected