"Kill" is not the same as "delete", and none of the concepts are applicable to
System.Threading.Mutex
. Generally, CLI objects don't need deletion, because the platform is managed. But with
Mutex
, you need to call
IDisposable.Dispose()
when this object is no longer needed, and this interface method is implemented by
System.Threading.WaitHandle.Dispose()
:
https://msdn.microsoft.com/en-us/library/dd384809%28v=vs.110%29.aspx[
^].
Moreover, the only reason why this interface is implemented is that those
WaitHandle
classes are based on unmanaged Windows API objects. Using this interface is the usual technique of unmanaged disposing of such objects.
Also, I'm not sure you really need
Mutex
. A number of users with native programming experience are unaware of .NET
lock
mechanism:
https://msdn.microsoft.com/en-us/library/c5kehkcz.aspx[
^].
—SA