[PyQt] "Cannot unlock an unlocked lock"

Matthieu Brucher matthieu.brucher at gmail.com
Tue Jul 1 22:17:54 BST 2008


2008/7/1 Phil Thompson <phil at riverbankcomputing.com>:
> On Tue, 1 Jul 2008 21:25:55 +0200, "Matthieu Brucher"
> <matthieu.brucher at gmail.com> wrote:
>> Hello,
>>
>> I'm trying to use a lock on a thread, and I use the following code :
>>
>>     try:
>>       self.lock.lockForWrite()
>>       self.currentScreen = 1 if self.currentScreen == 0 else 0
>>     finally:
>>       self.lock.unlock()
>>
>> The problem is that the finally close crashes with the following
>> assertion error:
>>
>> ASSERT failure in QReadWriteLock::unlock(): "Cannot unlock an unlocked
>> lock", file thread/qreadwritelock.cpp, line 346
>>
>> This is with Ubuntu, PyQt 4.4.3-2.
>> With Fedora 8, PyQt 4.3.3, the assertion does not failed.
>>
>> Any idea ?
>
> Not without a complete example that demonstrates the problem.

Thanks for the answer.
I tried to get a small sample, and I find my mistake. I had two locks
in a pool, and when I lock one for reading, I changed the lock I use,
resulting in unlocking the unlocked lock. But it is strange that
pyQt4.3.3 with Fedora 8 did not show the same behavior :(

Issue solved ;)

Matthieu
-- 
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher


More information about the PyQt mailing list