Files
mono/mcs/class/corlib/System.Threading/Monitor.cs
T
Dick Porter 58b4ee1b2c System.Threading class stubs.
svn path=/trunk/mcs/; revision=810
2001-09-13 12:47:25 +00:00

141 lines
3.1 KiB
C#
Executable File

//
// System.Threading.Monitor.cs
//
// Author:
// Dick Porter ([email protected])
//
// (C) Ximian, Inc. http://www.ximian.com
//
namespace System.Threading
{
public sealed class Monitor
{
public static void Enter(object obj) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
if(obj.GetType().IsValueType==true) {
throw new ArgumentException("Value type");
}
// FIXME
}
public static void Exit(object obj) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
if(obj.GetType().IsValueType==true) {
throw new ArgumentException("Value type");
}
// FIXME
}
public static void Pulse(object obj) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
// FIXME
}
public static void PulseAll(object obj) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
// FIXME
}
public static bool TryEnter(object obj) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
if(obj.GetType().IsValueType==true) {
throw new ArgumentException("Value type");
}
// FIXME
return(false);
}
public static bool TryEnter(object obj, int millisecondsTimeout) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
if(obj.GetType().IsValueType==true) {
throw new ArgumentException("Value type");
}
if(millisecondsTimeout<0) {
throw new ArgumentException("millisecondsTimeout negative");
}
// FIXME
return(false);
}
public static bool TryEnter(object obj, TimeSpan timeout) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
if(obj.GetType().IsValueType==true) {
throw new ArgumentException("Value type");
}
if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
throw new ArgumentOutOfRangeException("timeout out of range");
}
// FIXME
return(false);
}
public static bool Wait(object obj) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
// FIXME
return(false);
}
public static bool Wait(object obj, int millisecondsTimeout) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
// FIXME
return(false);
}
public static bool Wait(object obj, TimeSpan timeout) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
// LAMESPEC: says to throw ArgumentException too
if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
throw new ArgumentOutOfRangeException("timeout out of range");
}
// FIXME
return(false);
}
public static bool Wait(object obj, int millisecondsTimeout, bool exitContext) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
// FIXME
return(false);
}
public static bool Wait(object obj, TimeSpan timeout, bool exitContext) {
if(obj==null) {
throw new ArgumentNullException("obj");
}
// LAMESPEC: says to throw ArgumentException too
if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
throw new ArgumentOutOfRangeException("timeout out of range");
}
// FIXME
return(false);
}
}
}