I'm having a threadlock problem using the GetPointerTo functions generated by DefineThreadSafeScalarVar. I am using a callback function with the DAQmx acquire data function, and it uses some flags in a global struct to determine what to do with the data. The main program can set some of these flags in real time, and I'm running into a deadlock problem where the main program locks the pointer to set the flag, then DAQmx calls the callback routine to handle the next set of data and IT tries to get the pointer. Neither holds it for very long, but under certain circumstances this happens every time.
I could avoid the problem by taking the flags out of the struct and using the discrete GetXXX() and SetXXX() routines generated by DefineThreadSafeScalarVar if these routines were truly monatomic, that is they can guarantee that they will not be interrupted while setting or getting the variable value. Are these functions monatomic?