02-14-2014 02:08 AM
Hi,
How to release mutex in labwindow CVI.
I have one existing DLL . This DLL using method 'CreateMutex(NULL, TRUE, "USBDriverRunning");' .
We need to create another dll , this DLL be release Mutex 'USBDriverRunning'.
Thanks
Mukesh Kumar
02-14-2014 03:46 AM
CreateMutex returns an handle that is to be passed to ReleaseMutex for releasing the resource. After that you must call CloseHandle on the same handle to clean up everytging.
I don't know whether the handle of a mutex created with NULL in the first parameter can be passed to another DLL; I have never tried to do something similar but be careful with the following note int he function help:
If this parameter is NULL, the handle cannot be inherited by child processes.
You will need to carefully read the Remarks section of the function help and make your own tests.
02-14-2014 03:05 PM
To keep things simple I use CVI's Thread Lock functions.