NetworkManager/shared
Thomas Haller 4fad8c7c64 shared: add nm_utils_g_main_context_create_integrate_source() for integrating a GMainContext in another
We will rework NMClient entirely. Then, the synchronous initialization will also use
the asynchronous code paths. The difference will be that with synchronous initialization,
all D-Bus interaction will be done with an internal GMainContext as current thread default,
and that internal context will run until initialization completes.

Note that even after initialization completes, it cannot be swapped back to the user's
(outer) GMainContext. That is because contexts are essentially the queue for our
D-Bus events, and we cannot swap from one queue to the other in a race
free manner (or a full resync). In other words, the two contexts are not in sync,
so after using the internal context NMClient needs to stick to that (at least, until
the name owner gets lost, which gives an opportunity to resync and switch back to the
user's main context).

We thus need to hook the internal (inner) GMainContext with the user's (outer) context,
so when the user iterates the outer context, events on the inner context get dispatched.

Add nm_utils_g_main_context_create_integrate_source() to create such a GSource for
integrating two contexts.

Note that the use-case here is limited: the integrated, inner main context must
not be explicitly iterated except from being dispatched by the integrating
source. Otherwise, you'd get recursive runs, possible deadlocks and general
ugliness. NMClient must show restrain how to use the inner context while it is
integrated.
2019-11-25 12:58:33 +01:00
..
c-list shared/c-list: reimport 2019-04-14 17:22:04 +02:00
c-rbtree shared/c-rbtree: reimport 2019-04-14 17:23:01 +02:00
c-siphash shared/c-siphash: reimport 2019-04-14 17:23:25 +02:00
c-stdaux shared: patch c-stdaux.h to not include <stdatomic.h> 2019-04-14 17:17:52 +02:00
n-acd n-acd: fix leaking socket handle in n_acd_socket_new() when setsockopt() fails 2019-08-02 11:26:25 +02:00
n-dhcp4 n-dhcp4: log outgoing packets 2019-11-22 10:24:49 +01:00
nm-glib-aux shared: add nm_utils_g_main_context_create_integrate_source() for integrating a GMainContext in another 2019-11-25 12:58:33 +01:00
nm-libnm-core-aux all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-libnm-core-intern all: support 'stable' DHCP IAID 2019-11-11 10:33:31 +01:00
nm-std-aux all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-udev-aux all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-utils shared/tests: add nmtst_main_context_iterate_until() helper 2019-11-07 11:34:36 +01:00
systemd systemd: merge branch systemd into master 2019-11-20 09:22:53 +01:00
meson.build build/meson: cleanup configuration_data() for paths 2019-11-22 15:59:31 +01:00
nm-default.h libnm: include "nm-libnm-utils.h" by default in libnm sources 2019-10-18 22:09:18 +02:00
nm-meta-setting.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-meta-setting.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-test-libnm-utils.h tests: add nmtstc_client_new() helper 2019-11-07 11:34:36 +01:00
nm-test-utils-impl.c tests: add nmtstc_client_new() helper 2019-11-07 11:34:36 +01:00
nm-version-macros.h.in all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00