I am using a mutex that must remain locked across several function calls. Thus, it cannot be taken and then released at the beginning and end of each function, respectively. Thus, I am looking for a method to determine if I currently have ownership of a mutex. I had hoped that the WaitForSingleObject function would provide this information to me. However, from the documentation I have read, it appears that the code would indeed wait even if it had ownership.
Some additional information that might prove helpful:
- writing in C
- using CreateMutex/ReleaseMutex methods
Can anyone tell me how to check for ownership?