Wait for the destruction of sessions before tearing down main thread
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 22 Nov 2018 21:07:49 +0000 (16:07 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 4 Dec 2018 23:12:02 +0000 (18:12 -0500)
commit99d688f2849a22589351cf353edce0c756cddb74
treed9d1cf03f2dda8ba9f0e88a8461f65a58fea6bc5
parent938255db08ff910109dd372adc8fb1cf406162e0
Wait for the destruction of sessions before tearing down main thread

The main thread can no longer assume that it is the last thread to
use the session objects (since they are now ref-counted). Hence,
this commit introduces utils to allow the main thread to wait for
the destruction of all sessions.

The logic of the teardown is as follows:

1) The main thread waits for activity on the quit pipe.
2) Once the main thread unblocks, the main thread waits for the
   client thread to stop in order to guarantee that no new sessions
   are created.
3) The main thread then waits for the session list to be emptied
4) Once the session list is empty, continue the rest of the teardown
   as usual.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/lttng-sessiond.h
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/session.c
src/bin/lttng-sessiond/session.h
src/bin/lttng-sessiond/thread-utils.c
This page took 0.026754 seconds and 5 git commands to generate.