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>
Mon, 10 Dec 2018 20:24:49 +0000 (15:24 -0500)
commit6af972a23363fb55d26f43e59dcda84ce882915d
tree8ea2a2c93675a7feaecbef2fd5af239bffb7770e
parent420fd242c2ff0b1d6402c509aca35ffc15430e54
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.024966 seconds and 4 git commands to generate.