[glib] GBusNameOwnerFlags: Add DO_NOT_QUEUE flag



commit c53b44edb28b7aec62349a11a8263c488b35b70e
Author: Simon McVittie <smcv collabora com>
Date:   Mon Jun 19 12:41:53 2017 +0100

    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:
            ReleaseName(name)
            result = EXISTS
    
        return result
    
    (Modified by Philip Withnall to add documentation.)
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784392

 gio/gioenums.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/gioenums.h b/gio/gioenums.h
index 535eb62..bedc81b 100644
--- a/gio/gioenums.h
+++ b/gio/gioenums.h
@@ -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. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]