using System.Runtime.ConstrainedExecution;
using System.Security.AccessControl;
using System.IO;
+using System.Runtime.InteropServices;
#endif
namespace System.Threading
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class Mutex : WaitHandle
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
out bool created);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void ReleaseMutex_internal(IntPtr handle);
+ private static extern bool ReleaseMutex_internal(IntPtr handle);
#if NET_2_0
[MethodImplAttribute (MethodImplOptions.InternalCall)]
Handle = CreateMutex_internal (initiallyOwned, name, out createdNew);
}
+ public MutexSecurity GetAccessControl ()
+ {
+ throw new NotImplementedException ();
+ }
+
public static Mutex OpenExisting (string name)
{
return(OpenExisting (name, MutexRights.Synchronize |
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
#endif
public void ReleaseMutex() {
- ReleaseMutex_internal(Handle);
+ bool success = ReleaseMutex_internal(Handle);
+ if (!success) {
+ throw new ApplicationException ("Mutex is not owned");
+ }
}
+
+#if NET_2_0
+ public void SetAccessControl (MutexSecurity mutexSecurity)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
}
}