03-03-2016 09:01 AM
Is it possible to see if a thrad is locked. I does not have the lock name (not even if one was specified).
I miss a function like "RunState.Thread.IsLocked". Does anyone know if it is possible to get this information?
Thanks Vagn
03-03-2016 09:45 AM - last edited on 10-21-2024 05:06 PM by Content Cleaner
Hi! Looking at the documentation online for the Lock Step, it appears that there are a few properties that only exist if a thread is locked. Lock Step documentation here shows that the Step.Result.TimeoutOccurred property only exists if the thread is locked.
03-04-2016 02:38 AM
Hi Chantastic
Thanks for the answer but this is only valid for the lock step. If for instance the lock has been done on a subsequence call and I need to figure out inside the sub sequence if the sequence is locked or a previous lock step has locked the thread this information is not available.
03-04-2016 08:33 AM
That is not how thread synchronization is typically done. What exactly are you trying to do?
-Doug
03-11-2016 02:35 AM
Hi Doug
Normally my customers use batchmodel for testing and (for some different reasons) needs to lock threads. Creating functions (typically a sub sequences or just a VI) for my customer i need, in some cases, to know if the thread is locked.
The customer has different options to lock the thread:
- "Lock" step
- "Use Lock to Allow....." in "Synchronization" under step properties
(- "Batch Synchronization -serial" in "Synchronization" under step properties)
I can't use the suggestion by Chantastic! because I am not in the lock step and if the customer use the "Lock" in the synchronization tab the parameters does not exist.
Hope this answered your question Doug?
Vagn
03-15-2016 01:12 PM
Threads themselves are not locked, but rather they own locks and they can own more than one. Why do you need to know if the thread owns a lock?
-Doug