[concurrency-interest] Re: Improving RWLock compatibility - ownership test

Larry Riedel larryr@saturn.sdsu.edu
29 Nov 2004 18:58:53 -0000


> release() method of RWLocks doesn't check whether caller thread
> owns the lock.  The lock is always released, even when it was
> acquired by other thread. [...] I suggest to parameterize this
> behavior by adding an optional parameter to RWLock constructor.

I would like that, and/or a different class, and/or different
(public) methods (one which checks and one which does not).
In any case I think it should not be an implementation detail.
If there will be no choice, I prefer the method does verify
the owner, presuming that can be done extremely quickly.


Larry