| 268 | } |
| 269 | |
| 270 | void Stop() { |
| 271 | Shutdown(); |
| 272 | |
| 273 | TGuard<TMutex> g(StopMutex); |
| 274 | JoinListenerThreads(); |
| 275 | |
| 276 | while (AtomicGet(ConnectionCount)) { |
| 277 | usleep(10000); |
| 278 | Connections->Clear(); |
| 279 | } |
| 280 | |
| 281 | Connections.Destroy(); |
| 282 | Poller.Destroy(); |
| 283 | } |
| 284 | |
| 285 | void Shutdown() { |
| 286 | ListenWakeupWriteFd.Write("", 1); |