14 private static volatile int _Size = 0;
16 private static object s_TrackingServicesSyncObject =
null;
18 private static object TrackingServicesSyncObject
22 if (s_TrackingServicesSyncObject ==
null)
24 object value =
new object();
27 return s_TrackingServicesSyncObject;
38 lock (TrackingServicesSyncObject)
45 for (
int i = 0; i < _Size; i++)
47 array[i] = _Handlers[i];
66 lock (TrackingServicesSyncObject)
68 if (-1 != Match(handler))
72 if (_Handlers ==
null || _Size == _Handlers.Length)
75 if (_Handlers !=
null)
97 lock (TrackingServicesSyncObject)
99 int num = Match(handler);
104 Array.
Copy(_Handlers, num + 1, _Handlers, num, _Size - num - 1);
110 internal static void MarshaledObject(
object obj,
ObjRef or)
115 for (
int i = 0; i < _Size; i++)
117 Volatile.
Read(ref handlers[i]).MarshaledObject(obj, or);
126 internal static void UnmarshaledObject(
object obj, ObjRef or)
130 ITrackingHandler[] handlers = _Handlers;
131 for (
int i = 0; i < _Size; i++)
133 Volatile.
Read(ref handlers[i]).UnmarshaledObject(obj, or);
142 internal static void DisconnectedObject(
object obj)
146 ITrackingHandler[] handlers = _Handlers;
147 for (
int i = 0; i < _Size; i++)
157 private static int Match(ITrackingHandler handler)
160 for (
int i = 0; i < _Size; i++)
162 if (_Handlers[i] == handler)
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
static void Write(ref bool location, bool value)
Writes the specified value to the specified field. On systems that require it, inserts a memory barri...
Stores all relevant information required to generate a proxy in order to communicate with a remote ob...
static void RegisterTrackingHandler(ITrackingHandler handler)
Registers a new tracking handler with the T:System.Runtime.Remoting.Services.TrackingServices.
Provides information about, and means to manipulate, the current environment and platform....
Indicates that the implementing object must be notified of marshaling, unmarshaling,...
static ITrackingHandler [] RegisteredHandlers
Gets an array of the tracking handlers that are currently registered with T:System....
static int CompareExchange(ref int location1, int value, int comparand)
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Contains methods for performing volatile memory operations.
static bool Read(ref bool location)
Reads the value of the specified field. On systems that require it, inserts a memory barrier that pre...
static void UnregisterTrackingHandler(ITrackingHandler handler)
Unregisters the specified tracking handler from T:System.Runtime.Remoting.Services....
static void Copy(Array sourceArray, Array destinationArray, int length)
Copies a range of elements from an T:System.Array starting at the first element and pastes them into ...
Provides atomic operations for variables that are shared by multiple threads.
The exception that is thrown when something has gone wrong during remoting.
Provides a way to register, unregister, and obtain a list of tracking handlers.