328bd24 virthread: Introduce virRWLockInitPreferWriter

Authored and Committed by mprivozn 6 years ago
    virthread: Introduce virRWLockInitPreferWriter
    
    We already have virRWLockInit. But this uses pthread defaults
    which prefer reader to initialize the RW lock. This may lead to
    writer starvation. Therefore we need to have the counterpart that
    prefers writers. Now, according to the
    pthread_rwlockattr_setkind_np() man page setting
    PTHREAD_RWLOCK_PREFER_WRITER_NP attribute is no-op. Therefore we
    need to use PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
    attribute. So much for good enum value names.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
    
        
file modified
+1 -0
file modified
+35 -0
file modified
+1 -0