Tue Sep 10 12:12:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / class / corlib / System.Threading / Interlocked.cs
1 //
2 // System.Threading.Interlocked.cs
3 //
4 // Author:
5 //        Patrik Torstensson (patrik.torstensson@labs2.com)
6 //   Dick Porter (dick@ximian.com)
7 //
8 // (C) Ximian, Inc.  http://www.ximian.com
9 //
10
11 using System;
12 using System.Runtime.CompilerServices;
13
14 namespace System.Threading
15 {
16         public sealed class Interlocked 
17         {
18                 private Interlocked () {}
19
20                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
21                 public extern static int CompareExchange(ref int location1, int value, int comparand);
22
23                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
24                 public extern static object CompareExchange(ref object location1, object value, object comparand);
25
26                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
27                 public extern static float CompareExchange(ref float location1, float value, float comparand);
28
29                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
30                 public extern static int Decrement(ref int location);
31
32                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
33                 public extern static long Decrement(ref long location);
34
35                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
36                 public extern static int Increment(ref int location);
37
38                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
39                 public extern static long Increment(ref long location);
40
41                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
42                 public extern static int Exchange(ref int location1, int value);
43
44                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
45                 public extern static object Exchange(ref object location1, object value);
46
47                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
48                 public extern static float Exchange(ref float location1, float value);
49         }
50 }
51