Skip to content
  • Tim-Philipp Müller's avatar
    message, bus: fix async message delivery · da7847d1
    Tim-Philipp Müller authored
    Async message delivery (where the posting thread gets blocked
    until the message has been processed and/or freed) was pretty
    much completely broken.
    
    For one, don't use GMutex implementation details to check
    whether a mutex has been initialized or not, esp. not
    implementation details that don't hold true any more with
    newer GLib versions where atomic ops and futexes are used
    (spotted by Josep Torras). This led to async message
    delivery no longer blocking with newer GLib versions on
    Linux.
    
    Secondly, after async delivery don't free mutex/GCond
    embedded inside the just-freed message structure.
    
    Use a new (private) mini object flag to signal GstMessage
    that the message being freed is part of an async delivery
    on the bus so that the dispose handler can keep the message
    alive and the bus can free it once it's done cleaning up
    stuff.
    da7847d1