If this lock is not already held by the caller, the lock is acquired, then the internal counter is incremented by one.
Decrements the internal lock count by one. If this brings the count to zero, the lock is released.
If the lock is held by another caller, the method returns. Otherwise, the lock is acquired if it is not already held, and then the internal counter is incremented by one.
Instances of this class are used to ensure that an application cannot interfere with the locking mechanism used to implement asynchronous and synchronous communication between widgets and background threads.