(nextState State)
| 126 | } |
| 127 | |
| 128 | func (ts *ThreadState) Set(nextState State) { |
| 129 | ts.mu.Lock() |
| 130 | ts.currentState = nextState |
| 131 | ts.notifySubscribers(nextState) |
| 132 | ts.mu.Unlock() |
| 133 | } |
| 134 | |
| 135 | func (ts *ThreadState) notifySubscribers(nextState State) { |
| 136 | if len(ts.subscribers) == 0 { |