Skip to content
  • Stefan Ekenberg's avatar
    Prevent race condition in g_io_condition_get_type · 338741ff
    Stefan Ekenberg authored and Matthias Clasen's avatar Matthias Clasen committed
    Prevents race condition in function g_io_condition_get_type by ensuring
    that the initialization section for 'etype' is executed only once
    during a program's life time, and that concurrent threads are blocked
    until initialization completes. This changes solves the problem that
    concurrent threads could execute the check 'etype == 0' before any of
    them had initialized it, which in turn meant that multiple threads
    would then attempt to register the "GIOCondition" type.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750386
    338741ff