• Marko Mäkelä's avatar
    MDEV-34178: Improve the spin loops · f8d213bd
    Marko Mäkelä authored
    srw_mutex_impl<spinloop>::wait_and_lock(): Invoke srw_pause() and
    reload the lock word on each loop. Thanks to Mark Callaghan for
    suggesting this.
    
    ssux_lock_impl<spinloop>::rd_wait(): Actually implement a spin loop
    on the rw-lock component without blocking on the mutex component.
    If there is a conflict with wr_lock(), wait for writer.lock to be
    released without actually acquiring it.
    
    Reviewed by: Debarun Banerjee
    Tested by: Matthias Leich
    f8d213bd
srw_lock.cc 20.2 KB