public EventWaitHandle(bool initialState, EventResetMode mode) { bool created; bool manual = IsManualReset(mode); semaphore = CreateSemaphore(manual, initialState, null, out created); }
/* public EventWaitHandle (bool initialState, EventResetMode mode,string name) { bool created; bool manual = IsManualReset (mode); semaphore = CreateSemaphore(manual, initialState, name, out created); } public EventWaitHandle (bool initialState, EventResetMode mode, string name, out bool createdNew) { bool manual = IsManualReset (mode); semaphore = CreateSemaphore(manual, initialState, name, out createdNew); } */ private Java.Util.Concurrent.Semaphore CreateSemaphore(bool manual, bool initialState, string name, out bool createdNew) { if (!manual) throw new NotImplementedException("System.Threading.EventResetMode.AutoReset is not implemented"); var result = new Java.Util.Concurrent.Semaphore(1); if (initialState) result.Acquire(); createdNew = true; return result; }
/* * public EventWaitHandle (bool initialState, EventResetMode mode,string name) * { * bool created; * bool manual = IsManualReset (mode); * semaphore = CreateSemaphore(manual, initialState, name, out created); * } * * public EventWaitHandle (bool initialState, EventResetMode mode, string name, out bool createdNew) * { * bool manual = IsManualReset (mode); * semaphore = CreateSemaphore(manual, initialState, name, out createdNew); * } */ private Java.Util.Concurrent.Semaphore CreateSemaphore(bool manual, bool initialState, string name, out bool createdNew) { if (!manual) { throw new NotImplementedException("System.Threading.EventResetMode.AutoReset is not implemented"); } var result = new Java.Util.Concurrent.Semaphore(1); if (initialState) { result.Acquire(); } createdNew = true; return(result); }
public EventWaitHandle (bool initialState, EventResetMode mode) { bool created; bool manual = IsManualReset (mode); semaphore = CreateSemaphore(manual, initialState, null, out created); }