Why can I not writeLock after ReadLock?

Esben Mose Hansen kde at mosehansen.dk
Sat Nov 13 13:38:21 UTC 2010


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.

-- 
Kind regards, Esben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101113/63233094/attachment.html>


More information about the KDevelop-devel mailing list