NetworkManager/shared/nm-utils
Thomas Haller fcfd4f4ff2 logging: make nm-logging thread-safe
NetworkManager is single-threaded and uses a mainloop.

However, sometimes we may need multiple threads. For example, we will
need to write sysctl values asynchronously, using the glib thread-pool.
For that to work, we also need to switch the network-namespace of the
thread-pool thread. We want to use NMPNetns for that. Hence it's better
to have NMPNetns thread-safe, instead of coming up with a duplicate
implementation. But NMPNetns may want to log, so we also need nm-logging
thread-safe.

In general, code under "shared/nm-utils" and nm-logging should be usable
from multiple threads. It's simpler to make this code thread-safe than
re-implementing it. Also, it's a bad limitation to be unable to log
from other threads. If there is an error, the best we can often do is to
log about it.

Make nm-logging thread-safe. Actually, we only need to be able to log
from multiple threads. We don't need to setup or configure logging from
multiple threads. This restriction allows us to access logging from the
main-thread without any thread-synchronization (because all changes in
the logging setup are also done from the main-thread).

So, while logging from other threads requires a mutex, logging from the
main-thread is lock-free.
2019-02-05 08:18:08 +01:00
..
tests shared: suppress -Wstringop-truncation warning in nm_strndup_a() 2019-01-22 16:30:23 +01:00
c-list-util.c shared: implement c_list_sort() as non-recursive merge-sort 2018-01-03 16:41:47 +01:00
c-list-util.h shared: drop duplicate c-list.h header 2018-04-18 15:22:14 +02:00
nm-c-list.h shared: drop duplicate c-list.h header 2018-04-18 15:22:14 +02:00
nm-compat.c all: avoid g_memdup() 2018-09-07 11:24:17 +02:00
nm-compat.h shared/compat: add compat for nm_setting_vpn_get_data_keys() and nm_setting_vpn_get_secret_keys() 2017-11-23 14:44:25 +01:00
nm-dedup-multi.c Fix typos 2018-09-30 21:14:55 +02:00
nm-dedup-multi.h Fix typos 2018-09-30 21:14:55 +02:00
nm-enum-utils.c all: don't use gchar/gshort/gint/glong but C types 2018-07-11 12:02:06 +02:00
nm-enum-utils.h all: don't use gchar/gshort/gint/glong but C types 2018-07-11 12:02:06 +02:00
nm-errno.c platform: merge NMPlatformError with nm-error 2018-12-27 21:33:59 +01:00
nm-errno.h platform: merge NMPlatformError with nm-error 2018-12-27 21:33:59 +01:00
nm-glib.h shared/glib: add compat implementation for g_value_unset() to allow unintialized GValue 2019-01-07 10:09:10 +01:00
nm-hash-utils.c all: fix misspellings 2019-01-24 17:19:44 +01:00
nm-hash-utils.h shared: expose siphash24() related functionality in nm-hash-utils.h 2018-12-12 12:51:47 +01:00
nm-io-utils.c Fix typos 2018-09-30 21:14:55 +02:00
nm-io-utils.h shared: move file-get-contents and file-set-contents helper to shared/ 2018-09-04 07:38:30 +02:00
nm-jansson.h all: require jansson 2.5 2018-01-18 11:45:24 +01:00
nm-logging-fwd.h logging: make nm-logging thread-safe 2019-02-05 08:18:08 +01:00
nm-macros-internal.h shared: define NM_THREAD_SAFE_ON_MAIN_THREAD 2019-02-05 08:18:07 +01:00
nm-obj.h all: replace "it's" with "its" where needed 2018-04-18 14:14:07 +02:00
nm-random-utils.c Fix typos 2018-09-30 21:14:55 +02:00
nm-random-utils.h shared: split random and hash utils 2017-10-17 20:02:59 +02:00
nm-secret-utils.c shared: add nm-secret-utils.h helper 2018-09-04 07:38:30 +02:00
nm-secret-utils.h shared: avoid invoking g_free() with NULL from gs_free cleanup attribute 2018-10-04 10:58:50 +02:00
nm-shared-utils.c shared: add nm_utils_gettid() and NM_ASSERT_ON_MAIN_THREAD() 2019-02-05 08:18:07 +01:00
nm-shared-utils.h shared: add nm_utils_gettid() and NM_ASSERT_ON_MAIN_THREAD() 2019-02-05 08:18:07 +01:00
nm-test-utils.h tests: use NM_CONST_MAX() macro where a constant expression is required 2019-02-04 10:55:25 +01:00
nm-time-utils.c shared: thread safe initialization of nm_utils_get_monotonic_timestamp*() 2018-11-28 16:13:04 +01:00
nm-time-utils.h shared: move nm_utils_get_monotonic_timestamp*() to shared/nm-utils. 2018-10-18 12:16:55 +02:00
nm-udev-utils.c udev: remove unneeded NULL checks 2018-12-12 14:18:53 +01:00
nm-udev-utils.h udev: add and use nm_udev_utils_property_decode() function 2017-03-22 12:41:06 +01:00
nm-vpn-editor-plugin-call.h shared: include "gsystem-local-alloc.h" from "nm-glib.h" 2016-06-16 10:45:54 +02:00
nm-vpn-plugin-macros.h shared: add nm_utils_syslog_coerce_from_nm() util 2016-09-19 15:35:33 +02:00
nm-vpn-plugin-utils.c shared/vpn-plugin-utils: load the editor from the same place as plugin 2018-10-24 15:12:43 +02:00
nm-vpn-plugin-utils.h shared: add "nm-utils/nm-vpn-plugin-utils.h" 2016-06-16 10:45:54 +02:00
unaligned.h systemd: update code from upstream (2018-11-23) 2018-11-23 10:53:12 +01:00