| 102 | } |
| 103 | |
| 104 | void setState(STATE newState) |
| 105 | { |
| 106 | Synchronized sync(monitor_); |
| 107 | state_ = newState; |
| 108 | |
| 109 | // unblock start() with the knowledge that the thread has actually |
| 110 | // started running, which avoids a race in detached threads. |
| 111 | if (newState == started) { |
| 112 | monitor_.notify(); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Starts the thread. Does platform specific thread creation and |