Using the WaitForSingleObject Function.
If the function is called and times out, does it still need to release the mutex?
i.e. should ReleaseMutex be in position 1.
or 2.
if the five seconds elapse?
WaitForSingleObject(5 second time out)
{
//access shared resource
//1. - ReleaseMutex() here?
}
//2. - ReleaseMutex() here?