• Sergey Vojtovich's avatar
    MDEV-6483 - Deadlock around rw_lock_debug_mutex on PPC64 · 6192f0bf
    Sergey Vojtovich authored
    This problem affects only debug builds on PPC64.
    
    There are at least two race conditions around
    rw_lock_debug_mutex_enter and rw_lock_debug_mutex_exit:
    
    - rw_lock_debug_waiters was loaded/stored without setting
      appropriate locks/memory barriers.
    - there is a gap between calls to os_event_reset() and
      os_event_wait() and in such case we're supposed to pass
      return value of the former to the latter.
    
    Fixed by replacing self-cooked spinlocks with system mutexes.
    These days system mutexes offer much better performance. OTOH
    performance is not that critical for debug builds.
    6192f0bf
sync0sync.cc 43.9 KB