* Timer.cs: In Change, return false if the timer has been disposed.
In Dispose, notify the WaitHandle.
svn path=/trunk/mcs/; revision=25552
+2004-04-15 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * ThreadPool.cs: Added GetMinThreads and SetMinThreads.
+ * Timer.cs: In Change, return false if the timer has been disposed.
+ In Dispose, notify the WaitHandle.
+
2004-04-11 Lluis Sanchez Gual <lluis@ximian.com>
* ReaderWriterLock.cs: More fixes: never wait where acquiring a reader lock
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern void GetMaxThreads (out int workerThreads, out int completionPortThreads);
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public static extern void GetMinThreads (out int workerThreads, out int completionPortThreads);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public static extern void SetMinThreads (int workerThreads, int completionPortThreads);
+
public static bool QueueUserWorkItem (WaitCallback callback)
{
IAsyncResult ar = callback.BeginInvoke (null, null, null);
t.Start ();
}
- [MonoTODO("false return?")]
public bool Change (int dueTime, int period)
{
if (dueTime < -1)
if (period < -1)
throw new ArgumentOutOfRangeException ("period");
+ if (runner == null)
+ return false;
+
runner.DueTime = dueTime;
runner.Period = period;
runner.Abort ();
GC.SuppressFinalize (this);
}
- [MonoTODO("How do we signal the handler?")]
public bool Dispose (WaitHandle notifyObject)
{
Dispose ();
- return true; //FIXME
+ NativeEventCalls.SetEvent_internal (notifyObject.Handle);
+ return true;
}
~Timer ()