LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CmtGetLock Casuing one thread to Freeze

Hi.

I have a test system that tests two identical UUT's simultaneously using two threads of the same code. Within these two threads I require threadlocking so that a single hardware interface can be shared between the two units under test.

 

My problem is that occasionally (and randomly) either one of the threads seems to freeze at the CmtGetLock call and will not respond until the test software has been shut down and restarted. The other thread that doesn't freeze can carry on testing without a problem when the other one freezes.

 

The chopped down vesion of my code is something like below:

 

CmtNewLock ("Local\\UUT_IFDLL",OPT_TL_PROCESS_EVENTS_WHILE_WAITING, &gLockSTBinterfaceDll);

|

|

//blah blah blah

|

|

CmtGetLock (gLockSTBinterfaceDll);    //This is where one of either of the threads always freezes.

|

//use hardware interface

|

CmtReleaseLock (gLockSTBinterfaceDll);

|

//blah blah blah

|

 

Can anyone suggest a reason for this? Could it be an OS/PC problem?

 

Thanks.

  Neil.

 

 

0 Kudos
Message 1 of 2
(2,945 Views)
Duplicate post.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 2
(2,931 Views)