Regarding question 1, Castorix31 said very clearly, regarding question 2, the document also described clearly:
If name is not null and initiallyOwned is true, the calling thread owns the mutex only if the named system mutex was created as a result of this call. Since there is no mechanism for determining whether the named system mutex was created, it is better to specify false for initiallyOwned when calling this constructor overload. You can use the Mutex(Boolean, String, Boolean) constructor if you need to determine initial ownership.
The following questions are all about WaitOne.
The first parameter 0 indicates the time you want to wait.
Suppose you want to use a phone booth on the street. When you see someone in the phone booth is using it, will you leave immediately or wait for that person to complete the call?
0 means leave immediately, set to a certain value (milliseconds) means the time you waited, if the person is not over at that time, you will not continue to wait but leave.
You can also set it to -1, which means to wait indefinitely.
As for the second parameter exitContext, I tried to describe it in my own words, but found that my description will not be clearer than the explanation in this link:
WaitOne exitContext
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.