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
35 [MethodImplAttribute (MethodImplOptions.InternalCall)]
36 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
37 public extern static bool Read (ref bool location);
39 [MethodImplAttribute (MethodImplOptions.InternalCall)]
40 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
41 public extern static byte Read (ref byte location);
43 [MethodImplAttribute (MethodImplOptions.InternalCall)]
44 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
45 [CLSCompliant (false)]
46 public extern static sbyte Read (ref sbyte location);
48 [MethodImplAttribute (MethodImplOptions.InternalCall)]
49 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
50 public extern static short Read (ref short location);
52 [MethodImplAttribute (MethodImplOptions.InternalCall)]
53 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
54 [CLSCompliant (false)]
55 public extern static ushort Read (ref ushort location);
57 [MethodImplAttribute (MethodImplOptions.InternalCall)]
58 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
59 public extern static int Read (ref int location);
61 [MethodImplAttribute (MethodImplOptions.InternalCall)]
62 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
63 [CLSCompliant (false)]
64 public extern static uint Read (ref uint location);
66 [MethodImplAttribute (MethodImplOptions.InternalCall)]
67 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
68 public extern static long Read (ref long location);
70 [MethodImplAttribute (MethodImplOptions.InternalCall)]
71 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
72 [CLSCompliant (false)]
73 public extern static ulong Read (ref ulong location);
75 [MethodImplAttribute (MethodImplOptions.InternalCall)]
76 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
77 public extern static IntPtr Read (ref IntPtr location);
79 [MethodImplAttribute (MethodImplOptions.InternalCall)]
80 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
81 [CLSCompliant (false)]
82 public extern static UIntPtr Read (ref UIntPtr location);
84 [MethodImplAttribute (MethodImplOptions.InternalCall)]
85 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
86 public extern static double Read (ref double location);
88 [MethodImplAttribute (MethodImplOptions.InternalCall)]
89 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
90 public extern static float Read (ref float location);
92 [MethodImplAttribute (MethodImplOptions.InternalCall)]
93 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
94 public extern static T Read<T> (ref T location) where T : class;
96 [MethodImplAttribute (MethodImplOptions.InternalCall)]
97 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
98 public extern static void Write (ref bool location, bool value);
100 [MethodImplAttribute (MethodImplOptions.InternalCall)]
101 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
102 public extern static void Write (ref byte location, byte value);
104 [MethodImplAttribute (MethodImplOptions.InternalCall)]
105 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
106 [CLSCompliant (false)]
107 public extern static void Write (ref sbyte location, sbyte value);
109 [MethodImplAttribute (MethodImplOptions.InternalCall)]
110 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
111 public extern static void Write (ref short location, short value);
113 [MethodImplAttribute (MethodImplOptions.InternalCall)]
114 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
115 [CLSCompliant (false)]
116 public extern static void Write (ref ushort location, ushort value);
118 [MethodImplAttribute (MethodImplOptions.InternalCall)]
119 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
120 public extern static void Write (ref int location, int value);
122 [MethodImplAttribute (MethodImplOptions.InternalCall)]
123 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
124 [CLSCompliant (false)]
125 public extern static void Write (ref uint location, uint value);
127 [MethodImplAttribute (MethodImplOptions.InternalCall)]
128 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
129 public extern static void Write (ref long location, long value);
131 [MethodImplAttribute (MethodImplOptions.InternalCall)]
132 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
133 [CLSCompliant (false)]
134 public extern static void Write (ref ulong location, ulong value);
136 [MethodImplAttribute (MethodImplOptions.InternalCall)]
137 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
138 public extern static void Write (ref IntPtr location, IntPtr value);
140 [MethodImplAttribute (MethodImplOptions.InternalCall)]
141 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
142 [CLSCompliant (false)]
143 public extern static void Write (ref UIntPtr location, UIntPtr value);
145 [MethodImplAttribute (MethodImplOptions.InternalCall)]
146 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
147 public extern static void Write (ref double location, double value);
149 [MethodImplAttribute (MethodImplOptions.InternalCall)]
150 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
151 public extern static void Write (ref float location, float value);
153 [MethodImplAttribute (MethodImplOptions.InternalCall)]
154 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
155 public extern static void Write<T>(ref T location, T value) where T : class;