[Serializable]
public sealed class ExecutionContext : ISerializable {
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
private SecurityContext _sc;
#endif
private bool _suppressFlow;
internal ExecutionContext (ExecutionContext ec)
{
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
if (ec._sc != null)
_sc = new SecurityContext (ec._sc);
#endif
return null;
ExecutionContext capture = new ExecutionContext (ec);
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
if (SecurityManager.SecurityEnabled)
capture.SecurityContext = SecurityContext.Capture ();
#endif
}
// internal stuff
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
internal SecurityContext SecurityContext {
get {
if (_sc == null)
ec.FlowSuppressed = false;
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
[MonoTODO ("only the SecurityContext is considered")]
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
public static void Run (ExecutionContext executionContext, ContextCallback callback, object state)
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static byte[] ByteArrayToCurrentDomain (byte[] arr);
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
public static IPrincipal CurrentPrincipal {
get {
Thread th = CurrentThread;
}
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
// Stores a hash keyed by strings of LocalDataStoreSlot objects
static Hashtable datastorehash;
private static object datastore_lock = new object ();
internal_thread = it;
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
[Obsolete ("Deprecated in favor of GetApartmentState, SetApartmentState and TrySetApartmentState.")]
public ApartmentState ApartmentState {
get {
}
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
public ThreadPriority Priority {
get {
return(ThreadPriority.Lowest);
Abort_internal (Internal, null);
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
[SecurityPermission (SecurityAction.Demand, ControlThread=true)]
public void Abort (object stateInfo)
{
return Join_internal (Internal, millisecondsTimeout, Internal.system_thread_handle);
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
public bool Join(TimeSpan timeout)
{
long ms = (long) timeout.TotalMilliseconds;
public extern static void MemoryBarrier ();
#endif
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern void Resume_internal();
}
}
-#if NET_2_1 && !MONOTOUCH
+#if MOONLIGHT
private void StartSafe ()
{
current_thread = this;
Internal._serialized_principal = CurrentThread.Internal._serialized_principal;
// Thread_internal creates and starts the new thread,
-#if NET_2_1 && !MONOTOUCH
+#if MOONLIGHT
if (Thread_internal((ThreadStart) StartSafe) == (IntPtr) 0)
#else
if (Thread_internal((ThreadStart) StartUnsafe) == (IntPtr) 0)
throw new SystemException ("Thread creation failed.");
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void Suspend_internal(InternalThread thread);
// Managed and native threads are currently bound together.
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
public ApartmentState GetApartmentState ()
{
return (ApartmentState)Internal.apartment_state;
Start ();
}
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
// NOTE: This method doesn't show in the class library status page because
// it cannot be "found" with the StrongNameIdentityPermission for ECMA key.
// But it's there!