mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-24 02:32:16 +00:00
c022243aac
It can happen that queue::priv_::do_bring_workers_down stays forever waiting for a task to finish (via pthread_join). The it waits for is itself blocked in worker::wait_to_execute_a_task, in pthread_cond_wait. It seems to me that this is because we forget to lock the queue::priv::queue_cond_mutex before inspecting and updating the variables on which the wait on the condition depend. This patch fixes that. The patch also moves tests/test-read-write.cc over to using the work queue to increase test coverage for the work queue interface. * src/abg-workers.cc (queue::priv::tasks_todo_mutex): Make this data member mutable. (more_tasks_to_execute): (queue::priv::do_bring_workers_down): Update the queue::priv::bring_workers_down only in the critical section defined by queue::priv::queue_cond_mutex. (worker::wait_to_execute_a_task): Testing for queue::priv::bring_workers_down is done in the critical section defined by queue::priv::queue_cond_mutex. The loop over waiting ont the condition is also in the critical section, as it ought to be. * tests/test-read-write.cc (struct test_task): New type. (main): Express in terms of the new test_task type. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
data | ||
Makefile.am | ||
mockfedabipkgdiff.in | ||
print-diff-tree.cc | ||
runtestcanonicalizetypes.sh.in | ||
runtestdefaultsupprs.py.in | ||
runtestfedabipkgdiff.py.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-annotate.cc | ||
test-core-diff.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-ir-walker.cc | ||
test-lookup-syms.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-valgrind-suppressions.supp | ||
test-write-read-archive.cc | ||
update-test-output.py |