LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Checking state of CmtThreadLockHandle

I am trying to determine the state of the lock in error handling section of code where CmtGetLock() might have been called without calling CmtReleaseLock().  If I call CmtReleaseLock() and the lock is not held, then CVI complains and throws an error saying the lock is not held.

 

When debugging, I noticed the state of CmtThreadLockHandle is displayed in the variable window as "Held" or "Not Held".  Is there a way to check the lock state (i.e. "held" or "not held") in an if statement?  I guess I'm not quite sure what the data type (e.g. structure or enum) is and how to check it.

 

For instance, I am wondering if something like if (datalock == CmtThreadLockHandle.NOT_HELD) is possible.

0 Kudos
Message 1 of 1
(1,208 Views)