()
| 82 | func (handler *taskThread) drain() {} |
| 83 | |
| 84 | func (handler *taskThread) waitForTasks() { |
| 85 | for { |
| 86 | select { |
| 87 | case task := <-handler.execChan: |
| 88 | task.callback() |
| 89 | task.done.Unlock() // unlock the task to signal completion |
| 90 | case <-handler.thread.drainChan: |
| 91 | // thread is shutting down, do not execute the function |
| 92 | return |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func (handler *taskThread) execute(t *task) { |
| 98 | handler.execChan <- t |
no outgoing calls
no test coverage detected