• Marko Mäkelä's avatar
    MDEV-34178: Improve PERFORMANCE_SCHEMA instrumentation · 6cde03ae
    Marko Mäkelä authored
    When MariaDB is built with PERFORMANCE_SCHEMA support enabled
    and with futex-based rw-locks (not srw_lock_), we were unnecessarily
    releasing and reacquiring lock.writer in srw_lock_impl::psi_wr_lock()
    and ssux_lock::psi_wr_lock().
    
    If there is a conflict with rd_lock(), let us hold the lock.writer
    and execute u_wr_upgrade() to wait for rd_unlock().
    
    Reviewed by: Debarun Banerjee
    Tested by: Matthias Leich
    6cde03ae
srw_lock.cc 18.5 KB