<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I'd like to make sure, that the service name is not acquired and
    only one instance of my application is running at time.<br>
    I tried to use the g_bus_own_name_on_connection() method but it
    seems not to be the best one for my purposes.<br>
    <br>
    As I understand the description of this method, if the name is
    already acquired, the <em class="parameter"><code>bus_acquired_handler

      </code></em>will be called. My problem is that the handler will be
    called "sometime" later so after calling the method I have no idea
    if I shell proceed or not.<br>
    <br>
    id = g_bus_own_name_on_connection(...);<br>
    wait_for_handler <br>
    <br>
    is somehow dubious solution<br>
    <br>
    Additionally it seems there is (at least logical) bug in the return
    value (id) "that can be used with g_bus_unown_name() to stop owning
    the name".<br>
    Calling the method with G_BUS_NAME_OWNER_FLAGS_NONE flag I've
    started several applications and always got the return value equal
    1.<br>
    This flag shall inhibit the the loss of the name by other (already
    running) application, so the current application should not get any
    name, so there is no name to "stop owning" it.<br>
    Though the return value is 1 and I can call <br>
    <br>
    id = g_bus_own_name_on_connection(...);<br>
    g_bus_unown_name( id ); // ??? what now?<br>
    <br>
    Could somebody please <br>
    1) explain the correct usage of the method<br>
    2) tell me how to reliable (in the atomic way) achieve my goal from
    the 1st line<br>
    <br>
    thank you for your help,<br>
    <br>
    regards,<br>
    <br>
    Bogdan
    <div class="moz-signature"><br>
    </div>
  </body>
</html>