summaryrefslogtreecommitdiff
path: root/src/libelogind/sd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-19 12:29:04 +0100
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:49:58 +0200
commit22130b6b3c6d060b405bbc17d9a6a670001358ab (patch)
tree646c57d4240b3fe0bd2c0cf682c65f5d88b24cfa /src/libelogind/sd-bus
parent7b066907a79ea7546d5945fc079190370ed5e956 (diff)
tree-wide: install matches asynchronously
Let's remove a number of synchronization points from our service startups: let's drop synchronous match installation, and let's opt for asynchronous instead. Also, let's use sd_bus_match_signal() instead of sd_bus_add_match() where we can.
Diffstat (limited to 'src/libelogind/sd-bus')
-rw-r--r--src/libelogind/sd-bus/bus-track.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libelogind/sd-bus/bus-track.c b/src/libelogind/sd-bus/bus-track.c
index ab22d6e4d..919cebda0 100644
--- a/src/libelogind/sd-bus/bus-track.c
+++ b/src/libelogind/sd-bus/bus-track.c
@@ -259,9 +259,7 @@ _public_ int sd_bus_track_add_name(sd_bus_track *track, const char *name) {
bus_track_remove_from_queue(track); /* don't dispatch this while we work in it */
- track->n_adding++; /* make sure we aren't dispatched while we synchronously add this match */
- r = sd_bus_add_match(track->bus, &n->slot, match, on_name_owner_changed, track);
- track->n_adding--;
+ r = sd_bus_add_match_async(track->bus, &n->slot, match, on_name_owner_changed, NULL, track);
if (r < 0) {
bus_track_add_to_queue(track);
return r;