Try upgrades and downgrades for POSIX rwlocks

John Baldwin jhb at
Mon Jan 24 21:04:56 UTC 2011

Does anyone know if there is a de facto or proposed standard for supporting 
upgrades and downgrades in POSIX rwlocks?  IBM seems to support something 
rather gross where a wrlock() will succeed if the only shared lock is held by 
the current thread.  But then the thread holds both a read and write lock, and 
it has to call unlock twice, the first to drop the write lock, the second to 
drop the read lock.  If we were to add support for upgrades and downgrades I 
would prefer something more along the lines of our in-kernel APIs where there 
are try_upgrade() and downgrade() operations that convert a given lock between 

John Baldwin

More information about the freebsd-threads mailing list