Skip to content
  • Thomas Haller's avatar
    core: extend nm_shutdown_wait_obj_*() to support notification via a GCancellable · eae69e33
    Thomas Haller authored
    Now nm_shutdown_wait_obj_*() supports two styles:
    
     - NM_SHUTDOWN_WAIT_TYPE_OBJECT: this just registers a weak pointer
       on a source GObject. As long as the object is not destroyed
       (and the object is not unregistered), the shutdown gets blocked.
    
     - now new is NM_SHUTDOWN_WAIT_TYPE_CANCELLABLE: this source object
       is a GCancellable, and during shutdown, the system will cancel
       the instances to notify about the shutdown. That aside, the GCancellable
       is tracked exactly like a regular NM_SHUTDOWN_WAIT_TYPE_OBJECT (meaning:
       a weak pointer is registered and shutdown gets delayed as long as the instance
       lives).
    
    As the rest of the shutdown, it's not yet implemented on the shutdown-side.
    What is now possible is to register such cancellables, so that users can make
    use of this API before we fix shutdown. We cannot fix it all at the same time,
    so first users must be ready for this approach.
    eae69e33