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)
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>

No differences found
This page took 0.024311 seconds and 4 git commands to generate.