OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-cogutil commits / 7170e61

Futile attempt to fix deadlock
7170e617a185853468616ca295e9995066f311c4
by Linas Vepstas <linasvepstas@gmail.com> · 2025-12-07T04:20:45.000Z

Changed files (2) +8 -6

opencog/util/async_buffer.h +4 -3
……@@ -377,10 +377,11 @@ void async_buffer<Writer, Element>::drain()
377377 _flush_count++;
378378
379379 // Wait for all pending work to complete
380 while (0 < _pending)
380 unsigned long pend = _pending.load();
381 while (pend != 0)
381382 {
382 unsigned long pend = _pending.load();
383 if (pend > 0) _pending.wait(pend);
383 _pending.wait(pend);
384 pend = _pending.load();
384385 }
385386
386387 _stall_writers = save_stall;
opencog/util/async_method_caller.h +4 -3
……@@ -295,10 +295,11 @@ void async_caller<Writer, Element>::drain()
295295 _flush_count++;
296296
297297 // Wait for all pending work to complete
298 while (0 < _pending)
298 unsigned long pend = _pending.load();
299 while (pend != 0)
299300 {
300 unsigned long pend = _pending.load();
301 if (pend > 0) _pending.wait(pend);
301 _pending.wait(pend);
302 pend = _pending.load();
302303 }
303304}
304305