| … | … | @@ -335,10 +335,7 @@ void async_buffer<Writer, Element>::stop_writer_threads() |
| 335 | 335 | |
| 336 | 336 | // Wait until the writer threads are (mostly) done. |
| 337 | 337 | while (0 < _pending) |
| 338 | { | |
| 339 | unsigned long pend = _pending.load(); | |
| 340 | if (pend > 0) _pending.wait(pend); | |
| 341 | } | |
| 338 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); | |
| 342 | 339 | |
| 343 | 340 | // Now tell all the threads that they are done. |
| 344 | 341 | // I.e. cancel all the threads. |
| … | … | @@ -255,10 +255,7 @@ void async_caller<Writer, Element>::stop_writer_threads() |
| 255 | 255 | |
| 256 | 256 | // Wait until the writer threads are (mostly) done. |
| 257 | 257 | while (0 < _pending) |
| 258 | { | |
| 259 | unsigned long pend = _pending.load(); | |
| 260 | if (pend > 0) _pending.wait(pend); | |
| 261 | } | |
| 258 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); | |
| 262 | 259 | |
| 263 | 260 | // Now tell all the threads that they are done. |
| 264 | 261 | // I.e. cancel all the threads. |