core/trivial: add comment about GMainContext to nm_shutdown_wait_obj_register_full()

This commit is contained in:
Thomas Haller 2021-06-15 18:09:55 +02:00
parent 79d9441567
commit b8ae2dfa70
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -1051,6 +1051,12 @@ nm_shutdown_wait_obj_register_full(gpointer watched_obj,
if (G_UNLIKELY(!_shutdown_waitobj_lst_head.next))
c_list_init(&_shutdown_waitobj_lst_head);
/* Beware: there are callers with g_main_context_get_thread_default()
* not being g_main_context_get_default(). For example _fw_nft_call().
*
* If you schedule any sources or async operations, you probably need to
* make sure to use the default context. */
handle = g_slice_new(NMShutdownWaitObjHandle);
*handle = (NMShutdownWaitObjHandle){
/* depending on @free_msg_reason, we take ownership of @msg_reason.