Why can I not writeLock after ReadLock?

Milian Wolff mail at milianw.de
Sat Nov 13 13:52:40 UTC 2010


On Saturday 13 November 2010 14:38:21 Esben Mose Hansen wrote:
> On Saturday 13 November 2010 13:57:40 Milian Wolff wrote:
> > This function will block the current thread if
> > another thread has locked for reading or writing.
> 
> If functionA and functionB run simulatanously and both contained this
> pattern (upgrading a read lock to a write lock), the program would
> deadlock, with neither function able to obtain the read lock.
> 
> In fact, at the point they want to write, they are in an impossible
> situation: Both want to be able to modify the chain without anyone else
> touching it. If neither function can back down, the situation is
> inresolvable.

So not even QReadWriteLock has this implemented and the documentation is 
simply lacking this big gotcha?


-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101113/33adbcc0/attachment.sig>


More information about the KDevelop-devel mailing list