| … | … | @@ -365,7 +365,10 @@ void async_buffer<Writer, Element>::stop_writer_threads() |
| 365 | 365 | Element elt = _store_set.value_get(); |
| 366 | 366 | (_writer->*_do_write)(elt); |
| 367 | 367 | } |
| 368 | ||
| 368 | ||
| 369 | _barrier_phase = 0; | |
| 370 | _barrier_remaining = 0; | |
| 371 | ||
| 369 | 372 | // Its now OK to start new threads, if desired ...(!) |
| 370 | 373 | _stopping_writers = false; |
| 371 | 374 | } |
| … | … | @@ -385,10 +388,7 @@ void async_buffer<Writer, Element>::drain() |
| 385 | 388 | // XXX TODO - when C++20 becomes widely available, |
| 386 | 389 | // replace this loop by _pending.wait(0) |
| 387 | 390 | while (0 < _pending) |
| 388 | { | |
| 389 | 391 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); |
| 390 | // usleep(1000); | |
| 391 | } | |
| 392 | 392 | |
| 393 | 393 | _stall_writers = save_stall; |
| 394 | 394 | } |
| … | … | @@ -408,10 +408,7 @@ void async_buffer<Writer, Element>::flush() |
| 408 | 408 | _flush_count++; |
| 409 | 409 | |
| 410 | 410 | while (0 < _store_set.size()) |
| 411 | { | |
| 412 | 411 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); |
| 413 | // usleep(1000); | |
| 414 | } | |
| 415 | 412 | |
| 416 | 413 | _stall_writers = save_stall; |
| 417 | 414 | } |
| … | … | @@ -284,7 +284,10 @@ void async_caller<Writer, Element>::stop_writer_threads() |
| 284 | 284 | Element elt = _store_queue.value_pop(); |
| 285 | 285 | (_writer->*_do_write)(elt); |
| 286 | 286 | } |
| 287 | ||
| 287 | ||
| 288 | _barrier_phase = 0; | |
| 289 | _barrier_remaining = 0; | |
| 290 | ||
| 288 | 291 | // Its now OK to start new threads, if desired ...(!) |
| 289 | 292 | _stopping_writers = false; |
| 290 | 293 | } |
| … | … | @@ -302,10 +305,7 @@ void async_caller<Writer, Element>::drain() |
| 302 | 305 | // XXX TODO - when C++20 becomes widely available, |
| 303 | 306 | // replace this loop by _pending.wait(0) |
| 304 | 307 | while (0 < _pending) |
| 305 | { | |
| 306 | 308 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); |
| 307 | // usleep(1000); | |
| 308 | } | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | |
| … | … | @@ -321,10 +321,7 @@ void async_caller<Writer, Element>::flush_queue() |
| 321 | 321 | { |
| 322 | 322 | _flush_count++; |
| 323 | 323 | while (0 < _store_queue.size()) |
| 324 | { | |
| 325 | 324 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); |
| 326 | // usleep(1000); | |
| 327 | } | |
| 328 | 325 | } |
| 329 | 326 | |
| 330 | 327 | /// Drain the pending queue. Synchronizing. |