/// <include file='doc\WaitHandle.uex' path='docs/doc[@for="WaitHandle.Dispose"]/*' /> protected virtual void Dispose(bool explicitDisposing) { if (waitHandle != InvalidHandle) { lock (this) { if (waitHandle != InvalidHandle) { IntPtr copyOfHandle = waitHandle; waitHandle = InvalidHandle; Win32Native.CloseHandle(copyOfHandle); } } } }
protected internal override void FreeHandle(IntPtr handle) { // TODO: After RTM consider checking CloseHandle's return value. Win32Native.CloseHandle(handle); }