Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5516: Upgrade lock is not acquired when previous upgrade lock releases if another read lock is present
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-07 17:59:05
#5516: Upgrade lock is not acquired when previous upgrade lock releases if another
read lock is present
------------------------------------+---------------------------------------
Reporter: fred@⦠| Owner: viboes
Type: Bugs | Status: assigned
Milestone: To Be Determined | Component: thread
Version: Boost 1.42.0 | Severity: Problem
Resolution: | Keywords:
------------------------------------+---------------------------------------
Changes (by viboes):
* cc: viboes (added)
* owner: anthonyw => viboes
* status: new => assigned
Comment:
It seems to me that this is by definition of the provided feature.
From the documentation:
"This is an extension to the multiple-reader / single-write model provided
by the SharedLockable concept: a single thread may have upgradable
ownership at the same time as others have shared ownership. The thread
with upgradable ownership may at any time attempt to upgrade that
ownership to exclusive ownership. If no other threads have shared
ownership, the upgrade is completed immediately, and the thread now has
exclusive ownership, which must be relinquished by a call to unlock(),
just as if it had been acquired by a call to lock().
If a thread with upgradable ownership tries to upgrade whilst other
threads have shared ownership, the attempt will fail and the thread will
block until exclusive ownership can be acquired.
"
Of course the implementation could give priority to writers, but this
should be implemented in another class.
What is then wrong?
Moved to Support request until resolution clarified.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5516#comment:2> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC