瀏覽代碼

2005-02-20 Zoltan Varga <[email protected]>

	* Interlocked.cs: Applied patch from Luca Barbieri ([email protected]). Add NET 2.0 methods.

svn path=/trunk/mcs/; revision=40945
Zoltan Varga 21 年之前
父節點
當前提交
841ae4fa7d
共有 2 個文件被更改,包括 32 次插入0 次删除
  1. 3 0
      mcs/class/corlib/System.Threading/ChangeLog
  2. 29 0
      mcs/class/corlib/System.Threading/Interlocked.cs

+ 3 - 0
mcs/class/corlib/System.Threading/ChangeLog

@@ -1,3 +1,6 @@
+2005-02-20  Zoltan Varga  <[email protected]>
+
+	* Interlocked.cs: Applied patch from Luca Barbieri ([email protected]). Add NET 2.0 methods.
 
 Tue Feb 15 18:19:11 CET 2005 Paolo Molaro <[email protected]>
 

+ 29 - 0
mcs/class/corlib/System.Threading/Interlocked.cs

@@ -78,6 +78,35 @@ namespace System.Threading
 
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
 		public extern static float Exchange(ref float location1, float value);
+
+#if NET_2_0
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static long CompareExchange(ref long location1, long value, long comparand);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static IntPtr CompareExchange(ref IntPtr location1, IntPtr value, IntPtr comparand);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static double CompareExchange(ref double location1, double value, double comparand);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static long Exchange(ref long location1, long value);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static IntPtr Exchange(ref IntPtr location1, IntPtr value);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static double Exchange(ref double location1, double value);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static long Read(ref long location1);
+		
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static int Add(ref int location1, int add);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		public extern static long Add(ref long location1, long add);
+#endif
 	}
 }