NetworkManager/shared/nm-glib-aux
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
..
nm-c-list.h shared: add nm_c_list_for_each_entry_prev() helper macro 2019-10-18 22:09:18 +02:00
nm-dbus-aux.c shared: add nm_dbus_connection_call_finish_*_cb() helpers 2019-10-16 08:56:00 +02:00
nm-dbus-aux.h shared: add nm_dbus_connection_call_finish_*_cb() helpers 2019-10-16 08:56:00 +02:00
nm-dedup-multi.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dedup-multi.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-enum-utils.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-enum-utils.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-errno.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-errno.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-glib.h shared/nm-glib: add compat implementation for G_SOURCE_FUNC() 2019-11-22 15:32:52 +01:00
nm-hash-utils.c shared: add nm_pint_hash()/nm_pint_equals() utils 2019-11-25 12:58:33 +01:00
nm-hash-utils.h shared: add nm_pint_hash()/nm_pint_equals() utils 2019-11-25 12:58:33 +01:00
nm-io-utils.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-io-utils.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-jansson.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-json-aux.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-json-aux.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-keyfile-aux.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-keyfile-aux.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-logging-fwd.h core: move _LOG*() macros to "shared/nm-glib-aux/nm-logging-fwd.h" 2019-11-22 15:32:52 +01:00
nm-macros-internal.h shared: make NM_STRUCT_OFFSET_ENSURE_TYPE() work with arrays 2019-11-25 12:58:33 +01:00
nm-obj.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-random-utils.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-random-utils.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-ref-string.c shared: assert in nm_ref_string_unref() for valid NMRefString instance 2019-11-07 11:34:36 +01:00
nm-ref-string.h shared: add NM_IS_REF_STRING() helper 2019-10-27 14:30:51 +01:00
nm-secret-utils.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-secret-utils.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-shared-utils.c 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-shared-utils.h 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-time-utils.c shared: add nm_utils_monotonic_timestamp_from_boottime() util 2019-11-20 14:54:39 +01:00
nm-time-utils.h shared: add nm_utils_monotonic_timestamp_from_boottime() util 2019-11-20 14:54:39 +01:00
nm-value-type.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00