Commit c53b44ed authored by Simon McVittie's avatar Simon McVittie Committed by Philip Withnall

GBusNameOwnerFlags: Add DO_NOT_QUEUE flag

PulseAudio and LibreOffice are among the services that use this flag.
Refusing to queue for a name lets you do this transaction,
but atomically, avoiding the transient state where you briefly join
the queue and then are given the name when its primary owner drops it:

    result = RequestName(name)

    if result == IN_QUEUE:
        result = EXISTS

    return result

(Modified by Philip Withnall to add documentation.)
Signed-off-by: Philip Withnall's avatarPhilip Withnall <>
parent 92f1ba20
......@@ -952,6 +952,8 @@ typedef enum
* @G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT: Allow another message bus connection to claim the name.
* @G_BUS_NAME_OWNER_FLAGS_REPLACE: If another message bus connection owns the name and have
* specified #G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT, then take the name from the other connection.
* @G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE: If another message bus connection owns the name, immediately
* return an error from g_bus_own_name() rather than entering the waiting queue for that name. (Since 2.54)
* Flags used in g_bus_own_name().
......@@ -961,7 +963,8 @@ typedef enum
G_BUS_NAME_OWNER_FLAGS_NONE = 0, /*< nick=none >*/
G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT = (1<<0), /*< nick=allow-replacement >*/
G_BUS_NAME_OWNER_FLAGS_REPLACE = (1<<1) /*< nick=replace >*/
G_BUS_NAME_OWNER_FLAGS_REPLACE = (1<<1), /*< nick=replace >*/
G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE = (1<<2) /*< nick=do-not-queue >*/
} GBusNameOwnerFlags;
/* When adding new flags, their numeric values must currently match those
* used in the D-Bus Specification. */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment