5 // Marek Safar (marek.safar@gmail.com)
7 // Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 using System.Runtime.ConstrainedExecution;
28 using System.Runtime.CompilerServices;
30 namespace System.Threading
37 [MethodImplAttribute (MethodImplOptions.InternalCall)]
38 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
39 public extern static bool Read (ref bool location);
41 [MethodImplAttribute (MethodImplOptions.InternalCall)]
42 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
43 public extern static byte Read (ref byte location);
45 [MethodImplAttribute (MethodImplOptions.InternalCall)]
46 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
47 [CLSCompliant (false)]
48 public extern static sbyte Read (ref sbyte location);
50 [MethodImplAttribute (MethodImplOptions.InternalCall)]
51 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
52 public extern static short Read (ref short location);
54 [MethodImplAttribute (MethodImplOptions.InternalCall)]
55 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
56 [CLSCompliant (false)]
57 public extern static ushort Read (ref ushort location);
59 [MethodImplAttribute (MethodImplOptions.InternalCall)]
60 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
61 public extern static int Read (ref int location);
63 [MethodImplAttribute (MethodImplOptions.InternalCall)]
64 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
65 [CLSCompliant (false)]
66 public extern static uint Read (ref uint location);
68 [MethodImplAttribute (MethodImplOptions.InternalCall)]
69 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
70 public extern static long Read (ref long location);
72 [MethodImplAttribute (MethodImplOptions.InternalCall)]
73 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
74 [CLSCompliant (false)]
75 public extern static ulong Read (ref ulong location);
77 [MethodImplAttribute (MethodImplOptions.InternalCall)]
78 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
79 public extern static IntPtr Read (ref IntPtr location);
81 [MethodImplAttribute (MethodImplOptions.InternalCall)]
82 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
83 [CLSCompliant (false)]
84 public extern static UIntPtr Read (ref UIntPtr location);
86 [MethodImplAttribute (MethodImplOptions.InternalCall)]
87 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
88 public extern static double Read (ref double location);
90 [MethodImplAttribute (MethodImplOptions.InternalCall)]
91 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
92 public extern static float Read (ref float location);
94 [MethodImplAttribute (MethodImplOptions.InternalCall)]
95 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
96 public extern static T Read<T> (ref T location) where T : class;
98 [MethodImplAttribute (MethodImplOptions.InternalCall)]
99 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
100 public extern static void Write (ref bool location, bool value);
102 [MethodImplAttribute (MethodImplOptions.InternalCall)]
103 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
104 public extern static void Write (ref byte location, byte value);
106 [MethodImplAttribute (MethodImplOptions.InternalCall)]
107 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
108 [CLSCompliant (false)]
109 public extern static void Write (ref sbyte location, sbyte value);
111 [MethodImplAttribute (MethodImplOptions.InternalCall)]
112 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
113 public extern static void Write (ref short location, short value);
115 [MethodImplAttribute (MethodImplOptions.InternalCall)]
116 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
117 [CLSCompliant (false)]
118 public extern static void Write (ref ushort location, ushort value);
120 [MethodImplAttribute (MethodImplOptions.InternalCall)]
121 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
122 public extern static void Write (ref int location, int value);
124 [MethodImplAttribute (MethodImplOptions.InternalCall)]
125 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
126 [CLSCompliant (false)]
127 public extern static void Write (ref uint location, uint value);
129 [MethodImplAttribute (MethodImplOptions.InternalCall)]
130 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
131 public extern static void Write (ref long location, long value);
133 [MethodImplAttribute (MethodImplOptions.InternalCall)]
134 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
135 [CLSCompliant (false)]
136 public extern static void Write (ref ulong location, ulong value);
138 [MethodImplAttribute (MethodImplOptions.InternalCall)]
139 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
140 public extern static void Write (ref IntPtr location, IntPtr value);
142 [MethodImplAttribute (MethodImplOptions.InternalCall)]
143 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
144 [CLSCompliant (false)]
145 public extern static void Write (ref UIntPtr location, UIntPtr value);
147 [MethodImplAttribute (MethodImplOptions.InternalCall)]
148 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
149 public extern static void Write (ref double location, double value);
151 [MethodImplAttribute (MethodImplOptions.InternalCall)]
152 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
153 public extern static void Write (ref float location, float value);
155 [MethodImplAttribute (MethodImplOptions.InternalCall)]
156 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
157 public extern static void Write<T>(ref T location, T value) where T : class;