Using the [WaitForSingleObject](http://msdn.microsoft.com/en-us/library/ms687032%28v=vs.85%29.aspx) 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?

```