On Mar 16, 2006, at 11:19 PM, a.zatsepin wrote:

Hi all.

In MyWindow I add Property MyCriticalSection.
In thread I call MyWindow.MyCriticalSection.Enter (or TryEnter) and after that MyWindow.MyCriticalSection.Leave. Sometimes CriticalSection.Leave threw exception IllegalLockException. Why? What's wrong? What is the right way?

This indicates that you've called "Leave" without a corresponding "Enter". Make sure that for each Leave, you have a corresponding Enter, and that both calls are made from the same "conditions." Ie, make sure you don't have code that's like:

if something then
  ...
  MyCS.Enter
End if
..
MyCS.Leave

In this case, if "something" is false, you will get an IllegalLockException.

HTH,
Jon
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to