I'm trying to use a mutex to protect access to some hardware from multiple threads, but I'm confused as to what the exitContext
parameter means / does:
public virtual bool WaitOne (
int millisecondsTimeout,
bool exitContext
)
The docs say:
exitContext - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.
...but what does that actually mean and what are the consequences of setting it to either true or false? I've set it to true for now and the code appears to work, but I'm nervous that I don't fully understand what it's up to under the hood!