()
| 173 | |
| 174 | |
| 175 | void unpark() { |
| 176 | // This is racy with removeWaiter. The consequence of the race is that we may spuriously call |
| 177 | // unpark even though the thread has already removed itself from the list. But even if we did |
| 178 | // use a CAS, that race would still exist (it would just be ever so slightly smaller). |
| 179 | Thread w = thread; |
| 180 | if (w != null) { |
| 181 | thread = null; |
| 182 | LockSupport.unpark(w); |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | /** |