From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Debugger hangs requiring PC reset - CmtGetLock?

I have a LabWindows/CVI 2017 app that does I2C communication using an FTDI 4222 DLL.

 

I have been trying to debug a communication problem, and I run into a situation where my application hangs in the debugger. When I click "STOP" it shows a CmtGetLock call in red.  "GO" only hangs, and "STOP" returns to the same call.


Does CmtGetLock () hang? I thought it just tried to get the lock and returned an error if the lock was already in use?

 

Regardless, when this happens, I cannot abort my program, or even kill it in Task Manager.  I end up having to reboot this PC.

 

This is a new issue -- and I have not seen the debugger behave like this.

 

Any suggestions where I should look?

0 Kudos
Message 1 of 3
(1,197 Views)

As you can see in the help for the function, CmtGetLock () indeed hangs, i.e. waits forever for the lock to be free.

As an alternative you can use CmtTryToGetLock () which does not hang or GmtGetLockEx () which permits you to add a timeout (the help explains how to setup the code in this case)



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(1,179 Views)

Thanks -- I had a real rough day where it would hang at the lock and take the entire PC down (no way to exit without restarting). That happened a number of times one day, but now seems to have gone away so I'll just revisit that if it shows up again.

0 Kudos
Message 3 of 3
(1,135 Views)