[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Threading Monitor.cs,
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Threading Monitor.cs,1.9,1.10 Overlapped.cs,1.1,1.2 RegisteredWaitHandle.cs,1.3,1.4 Thread.cs,1.12,1.13 ThreadPool.cs,1.3,1.4 WaitHandle.cs,1.7,1.8 |
Date: |
Fri, 25 Apr 2003 00:45:15 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading
In directory subversions:/tmp/cvs-serv19991/runtime/System/Threading
Modified Files:
Monitor.cs Overlapped.cs RegisteredWaitHandle.cs Thread.cs
ThreadPool.cs WaitHandle.cs
Log Message:
Signature-compatibility fixes to a large number of classes.
Index: Monitor.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading/Monitor.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** Monitor.cs 15 Apr 2003 07:27:54 -0000 1.9
--- Monitor.cs 25 Apr 2003 04:45:13 -0000 1.10
***************
*** 2,6 ****
* Monitor.cs - Implementation of the "System.Threading.Monitor" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* Monitor.cs - Implementation of the "System.Threading.Monitor" class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 109,112 ****
--- 109,137 ----
return InternalWait(obj, TimeSpanToMS(timeout));
}
+ #if !ECMA_COMPAT
+ public static bool Wait(Object obj, int millisecondsTimeout,
+ bool exitContext)
+ {
+ if(obj == null)
+ {
+ throw new ArgumentNullException("obj");
+ }
+ if(millisecondsTimeout < -1)
+ {
+ throw new ArgumentOutOfRangeException
+ ("millisecondsTimeout",
+ _("ArgRange_NonNegOrNegOne"));
+ }
+ return InternalWait(obj, millisecondsTimeout);
+ }
+ public static bool Wait(Object obj, TimeSpan timeout, bool exitContext)
+ {
+ if(obj == null)
+ {
+ throw new ArgumentNullException("obj");
+ }
+ return InternalWait(obj, TimeSpanToMS(timeout));
+ }
+ #endif
// Internal version of "Wait". A timeout of -1 indicates
Index: Overlapped.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading/Overlapped.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Overlapped.cs 2 Apr 2003 02:23:21 -0000 1.1
--- Overlapped.cs 25 Apr 2003 04:45:13 -0000 1.2
***************
*** 91,94 ****
--- 91,106 ----
}
+ // Pack a native overlapped structure.
+ [CLSCompliant(false)]
+ public unsafe NativeOverlapped *Pack(IOCompletionCallback cb)
+ {
+ throw new NotImplementedException();
+ }
+ [CLSCompliant(false)]
+ public unsafe NativeOverlapped *UnsafePack(IOCompletionCallback cb)
+ {
+ throw new NotImplementedException();
+ }
+
// Unpack a native overlapped structure.
[CLSCompliant(false)]
Index: RegisteredWaitHandle.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading/RegisteredWaitHandle.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** RegisteredWaitHandle.cs 2 Apr 2003 04:58:25 -0000 1.3
--- RegisteredWaitHandle.cs 25 Apr 2003 04:45:13 -0000 1.4
***************
*** 39,42 ****
--- 39,48 ----
}
+ // Destructor.
+ ~RegisteredWaitHandle()
+ {
+ // Nothing to do here in this implementation.
+ }
+
// Unregister using a specific wait object.
public bool Unregister(WaitHandle waitObject)
Index: Thread.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading/Thread.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** Thread.cs 23 Apr 2003 11:00:43 -0000 1.12
--- Thread.cs 25 Apr 2003 04:45:13 -0000 1.13
***************
*** 23,27 ****
--- 23,30 ----
using System.Runtime.CompilerServices;
+ using System.Runtime.Remoting.Contexts;
+ using System.Security.Principal;
using System.Diagnostics;
+ using System.Globalization;
public sealed class Thread
***************
*** 42,45 ****
--- 45,53 ----
private String name;
+ #if !ECMA_COMPAT
+ // Flag that is set for threads in the thread pool.
+ internal bool inThreadPool;
+ #endif
+
// Constructor.
public Thread(ThreadStart start)
***************
*** 337,340 ****
--- 345,520 ----
[MethodImpl(MethodImplOptions.InternalCall)]
extern internal static int InternalGetThreadId();
+
+ #if !ECMA_COMPAT
+
+ // Allocate a local data store slot.
+ [TODO]
+ public static LocalDataStoreSlot AllocateDataSlot()
+ {
+ // TODO
+ return null;
+ }
+
+ // Allocate a named data store slot.
+ [TODO]
+ public static LocalDataStoreSlot AllocateNamedDataSlot(String name)
+ {
+ // TODO
+ return null;
+ }
+
+ // Free a named data store slot.
+ [TODO]
+ public static void FreeNamedDataSlot(String name)
+ {
+ // TODO
+ }
+
+ // Get the compressed stack for a thread.
+ public CompressedStack GetCompressedStack()
+ {
+ return CompressedStack.GetCompressedStack();
+ }
+
+ // Get the data in a particular data store slot.
+ [TODO]
+ public static Object GetData(LocalDataStoreSlot slot)
+ {
+ // TODO
+ return null;
+ }
+
+ // Get the current domain identifier.
+ [TODO]
+ public static int GetDomainID()
+ {
+ // TODO
+ return 0;
+ }
+
+ // Get a previously allocated named data store slot.
+ [TODO]
+ public static LocalDataStoreSlot GetNamedDataSlot(String name)
+ {
+ // TODO
+ return null;
+ }
+
+ // Interrupt this thread.
+ [TODO]
+ public void Interrupt()
+ {
+ // TODO
+ }
+
+ // Resume execution of this thread.
+ [TODO]
+ public void Resume()
+ {
+ // TODO
+ }
+
+ // Set the compressed stack for a thread.
+ public void SetCompressedStack(CompressedStack stack)
+ {
+ // Ignored - not used in this implementation.
+ }
+
+ // Set the data in a particular local data store slot.
+ [TODO]
+ public static void SetData(LocalDataStoreSlot slot, Object data)
+ {
+ // TODO
+ }
+
+ // Perform a spin wait for a given number of iterations.
+ [TODO]
+ public static void SpinWait(int iterations)
+ {
+ // TODO
+ }
+
+ // Suspend execution of this thread.
+ [TODO]
+ public void Suspend()
+ {
+ // TODO
+ }
+
+ // Get or set this thread's apartment state.
+ public ApartmentState ApartmentState
+ {
+ get
+ {
+ return ApartmentState.Unknown;
+ }
+ set
+ {
+ // Ignored - we don't use apartment
states.
+ }
+ }
+
+ // Get the remoting context for the current thread.
+ [TODO]
+ public static Context CurrentContext
+ {
+ get
+ {
+ // TODO
+ return null;
+ }
+ }
+
+ // Get or set the current culture for the thread.
+ public CultureInfo CurrentCulture
+ {
+ get
+ {
+ return CultureInfo.CurrentCulture;
+ }
+ set
+ {
+ // Ignored - not used at present.
+ }
+ }
+
+ // Get or set the principal representing the thread's security context.
+ [TODO]
+ public static IPrincipal CurrentPrincipal
+ {
+ get
+ {
+ // TODO
+ return null;
+ }
+ set
+ {
+ // TODO
+ }
+ }
+
+ // Get or set the current UI culture for the thread.
+ public CultureInfo CurrentUICulture
+ {
+ get
+ {
+ return CultureInfo.CurrentUICulture;
+ }
+ set
+ {
+ // Ignored - not used at present.
+ }
+ }
+
+ // Determine if this is a thread pool thread.
+ public bool IsThreadPoolThread
+ {
+ get
+ {
+ return inThreadPool;
+ }
+ }
+
+ #endif // !ECMA_COMPAT
}; // class Thread
Index: ThreadPool.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading/ThreadPool.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ThreadPool.cs 3 Apr 2003 05:40:44 -0000 1.3
--- ThreadPool.cs 25 Apr 2003 04:45:13 -0000 1.4
***************
*** 36,39 ****
--- 36,43 ----
private const int MaxCompletionThreads = 16;
+ // Minimum number of threads in the pool.
+ private const int MinWorkerThreads = 0;
+ private const int MinCompletionThreads = 0;
+
// Internal state.
private static int usedWorkerThreads;
***************
*** 77,80 ****
--- 81,100 ----
}
+ // Get the minimum number of threads that should exist in the thread
pool.
+ public static void GetMinThreads(out int workerThreads,
+ out
int completionPortThreads)
+ {
+ workerThreads = MinWorkerThreads;
+ completionPortThreads = MinCompletionThreads;
+ }
+
+ // Set the minimum number of threads that should exist in the thread
pool.
+ public static bool SetMinThreads(int workerThreads,
+ int
completionPortThreads)
+ {
+ // Ignored - we let the pool decide how big it
should be.
+ return false;
+ }
+
// Queue a new work item within the thread pool.
public static bool QueueUserWorkItem(WaitCallback callBack, Object
state)
***************
*** 370,373 ****
--- 390,396 ----
}
Thread thread = new
Thread(new ThreadStart(Work));
+ #if !ECMA_COMPAT
+ thread.inThreadPool =
true;
+ #endif
workerThreads[numWorkerThreads++] = thread;
thread.IsBackground =
true;
***************
*** 420,423 ****
--- 443,449 ----
Thread thread =
new Thread(new
ThreadStart(Complete));
+ #if !ECMA_COMPAT
+ thread.inThreadPool =
true;
+ #endif
completionThreads[numCompletionThreads++] = thread;
thread.IsBackground =
true;
Index: WaitHandle.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Threading/WaitHandle.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** WaitHandle.cs 17 Feb 2003 08:25:23 -0000 1.7
--- WaitHandle.cs 25 Apr 2003 04:45:13 -0000 1.8
***************
*** 2,6 ****
* WaitHandle.cs - Implementation of the "System.Threading.WaitHandle" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* WaitHandle.cs - Implementation of the "System.Threading.WaitHandle" class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 31,37 ****
private IntPtr privateData;
! /// <summary>
! /// Constant that specifies a timeout occured within the
! /// WaitAny or WaitAll methods.
/// </summary>
public const int WaitTimeout = 258;
--- 31,37 ----
private IntPtr privateData;
! /// <summary>
! /// Constant that specifies a timeout occured within the
! /// WaitAny or WaitAll methods.
/// </summary>
public const int WaitTimeout = 258;
***************
*** 204,211 ****
int timeout);
// Get the private handle associated with this object.
// Note: Microsoft's implementation allows the handle
// to be set here, but that's too dangerous to allow.
! public IntPtr Handle
{
get
--- 204,214 ----
int timeout);
+ // Value of an invalid handle.
+ protected static readonly IntPtr InvalidHandle = IntPtr.Zero;
+
// Get the private handle associated with this object.
// Note: Microsoft's implementation allows the handle
// to be set here, but that's too dangerous to allow.
! public virtual IntPtr Handle
{
get
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Threading Monitor.cs,1.9,1.10 Overlapped.cs,1.1,1.2 RegisteredWaitHandle.cs,1.3,1.4 Thread.cs,1.12,1.13 ThreadPool.cs,1.3,1.4 WaitHandle.cs,1.7,1.8,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/Remoting/Contexts Context.cs,1.2,1.3
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/Remoting/Messaging AsyncResult.cs,1.4,1.5 MethodCall.cs,1.2,1.3MethodResponse.cs,1.2,1.3
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/Remoting/Contexts Context.cs,1.2,1.3
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/Remoting/Messaging AsyncResult.cs,1.4,1.5 MethodCall.cs,1.2,1.3MethodResponse.cs,1.2,1.3
- Index(es):