I'm working on 2 Windows Services that have a common database which I want to lock (cross-process) with a system Mutex.
Now I'm wondering whether it's ok to just call WaitOne()
and ReleaseMutex()
in a try-finally
block or should I also dispose the Mutex (e.g. in a using
block). If so I guess I should always catch the AbandonedMutexException
on the WaitOne()
method or am I wrong here?