2 // System.Threading.Thread.cs
5 // Dick Porter (dick@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
8 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 using System.Runtime.Remoting.Contexts;
31 using System.Runtime.Serialization;
32 using System.Runtime.Serialization.Formatters.Binary;
33 using System.Security.Permissions;
34 using System.Security.Principal;
35 using System.Globalization;
36 using System.Runtime.CompilerServices;
37 using System.Runtime.InteropServices;
39 using System.Collections;
40 using System.Security;
43 using System.Runtime.ConstrainedExecution;
46 namespace System.Threading {
48 [ClassInterface (ClassInterfaceType.None)]
51 [ComDefaultInterface (typeof (_Thread))]
53 public sealed class Thread : _Thread {
55 #region Sync with metadata/object-internals.h
57 // stores a thread handle
58 private IntPtr system_thread_handle;
60 private IntPtr culture_info;
61 private IntPtr ui_culture_info;
62 private bool threadpool_thread;
63 /* accessed only from unmanaged code */
66 private ThreadState state = ThreadState.Unstarted;
67 private object abort_exc;
68 internal object abort_state;
69 /* thread_id is only accessed from unmanaged code */
70 private Int64 thread_id;
72 /* start_notify is used by the runtime to signal that Start()
75 private IntPtr start_notify;
76 private IntPtr stack_ptr;
77 private IntPtr static_data;
78 private IntPtr jit_data;
79 private IntPtr lock_data;
80 Context current_appcontext;
83 private IntPtr appdomain_refs;
84 private bool interruption_requested;
85 private IntPtr suspend_event;
86 private IntPtr suspended_event;
87 private IntPtr resume_event;
88 /* Don't lock on synch_lock in managed code, since it can result in deadlocks */
89 private object synch_lock = new Object();
90 private IntPtr serialized_culture_info;
91 private int serialized_culture_info_len;
92 private IntPtr serialized_ui_culture_info;
93 private int serialized_ui_culture_info_len;
94 private ExecutionContext _ec;
96 * These fields are used to avoid having to increment corlib versions
97 * when a new field is added to the unmanaged MonoThread structure.
99 private IntPtr unused1;
100 private IntPtr unused2;
101 private IntPtr unused3;
102 private IntPtr unused4;
103 private IntPtr unused5;
104 private IntPtr unused6;
105 private IntPtr unused7;
109 static Hashtable slothash;
111 // can be both a ThreadSart and a ParameterizedThreadStart
112 private MulticastDelegate threadstart;
113 private string thread_name=null;
115 private IPrincipal _principal;
117 public static Context CurrentContext {
118 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure=true)]
120 return(AppDomain.InternalGetContext ());
124 public static IPrincipal CurrentPrincipal {
127 Thread th = CurrentThread;
131 p = GetDomain ().DefaultPrincipal;
137 [SecurityPermission (SecurityAction.Demand, ControlPrincipal = true)]
139 CurrentThread._principal = value;
143 // Looks up the object associated with the current thread
144 [MethodImplAttribute(MethodImplOptions.InternalCall)]
145 private extern static Thread CurrentThread_internal();
147 public static Thread CurrentThread {
149 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
152 return(CurrentThread_internal());
156 internal static int CurrentThreadId {
158 return (int)(CurrentThread.thread_id);
162 // Stores a hash keyed by strings of LocalDataStoreSlot objects
163 static Hashtable datastorehash;
164 private static object datastore_lock = new object ();
166 private static void InitDataStoreHash () {
167 lock (datastore_lock) {
168 if (datastorehash == null) {
169 datastorehash = Hashtable.Synchronized(new Hashtable());
174 public static LocalDataStoreSlot AllocateNamedDataSlot(string name) {
175 lock (datastore_lock) {
176 if (datastorehash == null)
177 InitDataStoreHash ();
178 LocalDataStoreSlot slot = (LocalDataStoreSlot)datastorehash[name];
180 // This exception isnt documented (of
181 // course) but .net throws it
182 throw new ArgumentException("Named data slot already added");
185 slot = new LocalDataStoreSlot();
187 datastorehash.Add(name, slot);
193 public static void FreeNamedDataSlot(string name) {
194 lock (datastore_lock) {
195 if (datastorehash == null)
196 InitDataStoreHash ();
197 LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
200 datastorehash.Remove(slot);
205 private static Hashtable SlotHash {
207 if (slothash == null)
208 slothash = new Hashtable ();
213 public static LocalDataStoreSlot AllocateDataSlot() {
214 return new LocalDataStoreSlot();
217 public static object GetData(LocalDataStoreSlot slot) {
218 return SlotHash [slot];
221 public static void SetData(LocalDataStoreSlot slot,
223 SlotHash [slot] = data;
226 public static AppDomain GetDomain() {
227 return AppDomain.CurrentDomain;
230 [MethodImplAttribute(MethodImplOptions.InternalCall)]
231 public extern static int GetDomainID();
233 public static LocalDataStoreSlot GetNamedDataSlot(string name) {
234 lock (datastore_lock) {
235 if (datastorehash == null)
236 InitDataStoreHash ();
237 LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
240 slot=AllocateNamedDataSlot(name);
247 [MethodImplAttribute(MethodImplOptions.InternalCall)]
248 private extern static void ResetAbort_internal();
250 [SecurityPermission (SecurityAction.Demand, ControlThread=true)]
251 public static void ResetAbort ()
253 ResetAbort_internal ();
256 [MethodImplAttribute(MethodImplOptions.InternalCall)]
257 private extern static void Sleep_internal(int ms);
259 public static void Sleep(int millisecondsTimeout) {
260 if((millisecondsTimeout<0) && (millisecondsTimeout != Timeout.Infinite)) {
261 throw new ArgumentException("Negative timeout");
263 Sleep_internal(millisecondsTimeout);
266 public static void Sleep(TimeSpan timeout) {
267 // LAMESPEC: says to throw ArgumentException too
268 int ms=Convert.ToInt32(timeout.TotalMilliseconds);
270 if(ms < 0 || ms > Int32.MaxValue) {
271 throw new ArgumentOutOfRangeException("Timeout out of range");
277 // Returns the system thread handle
278 [MethodImplAttribute(MethodImplOptions.InternalCall)]
279 private extern IntPtr Thread_internal (MulticastDelegate start);
281 public Thread(ThreadStart start) {
283 throw new ArgumentNullException("Null ThreadStart");
290 [Obsolete ("Deprecated in favor of GetApartmentState, SetApartmentState and TrySetApartmentState.")]
292 public ApartmentState ApartmentState {
294 return(ApartmentState.Unknown);
301 [MethodImplAttribute (MethodImplOptions.InternalCall)]
302 private static extern int current_lcid ();
304 [MethodImplAttribute (MethodImplOptions.InternalCall)]
305 private extern CultureInfo GetCachedCurrentCulture ();
307 [MethodImplAttribute (MethodImplOptions.InternalCall)]
308 private extern byte[] GetSerializedCurrentCulture ();
310 [MethodImplAttribute (MethodImplOptions.InternalCall)]
311 private extern void SetCachedCurrentCulture (CultureInfo culture);
313 [MethodImplAttribute (MethodImplOptions.InternalCall)]
314 private extern void SetSerializedCurrentCulture (byte[] culture);
316 [MethodImplAttribute (MethodImplOptions.InternalCall)]
317 private extern CultureInfo GetCachedCurrentUICulture ();
319 [MethodImplAttribute (MethodImplOptions.InternalCall)]
320 private extern byte[] GetSerializedCurrentUICulture ();
322 [MethodImplAttribute (MethodImplOptions.InternalCall)]
323 private extern void SetCachedCurrentUICulture (CultureInfo culture);
325 [MethodImplAttribute (MethodImplOptions.InternalCall)]
326 private extern void SetSerializedCurrentUICulture (byte[] culture);
328 /* If the current_lcid() isn't known by CultureInfo,
329 * it will throw an exception which may cause
330 * String.Concat to try and recursively look up the
331 * CurrentCulture, which will throw an exception, etc.
332 * Use a boolean to short-circuit this scenario.
334 private static bool in_currentculture=false;
336 static object culture_lock = new object ();
339 * Thread objects are shared between appdomains, and CurrentCulture
340 * should always return an object in the calling appdomain. See bug
341 * http://bugzilla.ximian.com/show_bug.cgi?id=50049 for more info.
342 * This is hard to implement correctly and efficiently, so the current
343 * implementation is not perfect: changes made in one appdomain to the
344 * state of the current cultureinfo object are not visible to other
347 public CultureInfo CurrentCulture {
349 if (in_currentculture)
351 return CultureInfo.InvariantCulture;
353 CultureInfo culture = GetCachedCurrentCulture ();
357 byte[] arr = GetSerializedCurrentCulture ();
359 lock (culture_lock) {
360 in_currentculture=true;
361 culture = CultureInfo.ConstructCurrentCulture ();
363 // Don't serialize the culture in this case to avoid
364 // initializing the serialization infrastructure in the
365 // common case when the culture is not set explicitly.
367 SetCachedCurrentCulture (culture);
368 in_currentculture = false;
374 * No cultureinfo object exists for this domain, so create one
375 * by deserializing the serialized form.
377 in_currentculture = true;
379 BinaryFormatter bf = new BinaryFormatter ();
380 MemoryStream ms = new MemoryStream (arr);
381 culture = (CultureInfo)bf.Deserialize (ms);
382 SetCachedCurrentCulture (culture);
384 in_currentculture = false;
390 [SecurityPermission (SecurityAction.Demand, ControlThread=true)]
393 throw new ArgumentNullException ("value");
395 value.CheckNeutral ();
396 in_currentculture = true;
398 BinaryFormatter bf = new BinaryFormatter();
399 MemoryStream ms = new MemoryStream ();
400 bf.Serialize (ms, value);
402 SetCachedCurrentCulture (value);
403 SetSerializedCurrentCulture (ms.GetBuffer ());
405 in_currentculture = false;
410 public CultureInfo CurrentUICulture {
412 if (in_currentculture)
414 return CultureInfo.InvariantCulture;
416 CultureInfo culture = GetCachedCurrentUICulture ();
420 byte[] arr = GetSerializedCurrentUICulture ();
422 lock (culture_lock) {
423 in_currentculture=true;
430 culture = CultureInfo.ConstructCurrentUICulture ();
432 // Don't serialize the culture in this case to avoid
433 // initializing the serialization infrastructure in the
434 // common case when the culture is not set explicitly.
436 SetCachedCurrentUICulture (culture);
437 in_currentculture = false;
443 * No cultureinfo object exists for this domain, so create one
444 * by deserializing the serialized form.
446 in_currentculture = true;
448 BinaryFormatter bf = new BinaryFormatter ();
449 MemoryStream ms = new MemoryStream (arr);
450 culture = (CultureInfo)bf.Deserialize (ms);
451 SetCachedCurrentUICulture (culture);
454 in_currentculture = false;
461 in_currentculture = true;
464 throw new ArgumentNullException ("value");
467 BinaryFormatter bf = new BinaryFormatter();
468 MemoryStream ms = new MemoryStream ();
469 bf.Serialize (ms, value);
471 SetCachedCurrentUICulture (value);
472 SetSerializedCurrentUICulture (ms.GetBuffer ());
474 in_currentculture = false;
479 public bool IsThreadPoolThread {
481 return IsThreadPoolThreadInternal;
485 internal bool IsThreadPoolThreadInternal {
487 return threadpool_thread;
490 threadpool_thread = value;
494 public bool IsAlive {
496 ThreadState curstate = GetState ();
498 if((curstate & ThreadState.Aborted) != 0 ||
499 (curstate & ThreadState.Stopped) != 0 ||
500 (curstate & ThreadState.Unstarted) != 0) {
508 public bool IsBackground {
510 return (GetState () & ThreadState.Background) != 0;
515 SetState (ThreadState.Background);
517 ClrState (ThreadState.Background);
522 [MethodImplAttribute(MethodImplOptions.InternalCall)]
523 private extern string GetName_internal ();
525 [MethodImplAttribute(MethodImplOptions.InternalCall)]
526 private extern void SetName_internal (String name);
529 * The thread name must be shared by appdomains, so it is stored in
535 return GetName_internal ();
539 SetName_internal (value);
544 public ThreadPriority Priority {
546 return(ThreadPriority.Lowest);
553 public ThreadState ThreadState {
559 [MethodImplAttribute(MethodImplOptions.InternalCall)]
560 private extern void Abort_internal (object stateInfo);
562 [SecurityPermission (SecurityAction.Demand, ControlThread=true)]
565 Abort_internal (null);
568 [SecurityPermission (SecurityAction.Demand, ControlThread=true)]
569 public void Abort (object stateInfo)
571 Abort_internal (stateInfo);
576 [SecurityPermission (SecurityAction.Demand, ControlThread=true)]
577 public void Interrupt ()
579 throw new NotImplementedException ();
582 // The current thread joins with 'this'. Set ms to 0 to block
583 // until this actually exits.
584 [MethodImplAttribute(MethodImplOptions.InternalCall)]
585 private extern bool Join_internal(int ms, IntPtr handle);
589 Join_internal(Timeout.Infinite, system_thread_handle);
592 public bool Join(int millisecondsTimeout)
594 if (millisecondsTimeout != Timeout.Infinite && millisecondsTimeout < 0)
595 throw new ArgumentException ("Timeout less than zero", "millisecondsTimeout");
597 return Join_internal(millisecondsTimeout, system_thread_handle);
600 public bool Join(TimeSpan timeout)
602 // LAMESPEC: says to throw ArgumentException too
603 int ms=Convert.ToInt32(timeout.TotalMilliseconds);
605 if(ms < 0 || ms > Int32.MaxValue) {
606 throw new ArgumentOutOfRangeException("timeout out of range");
608 return Join_internal(ms, system_thread_handle);
612 [MethodImplAttribute(MethodImplOptions.InternalCall)]
613 public extern static void MemoryBarrier ();
615 [MethodImplAttribute(MethodImplOptions.InternalCall)]
616 private extern void Resume_internal();
621 [SecurityPermission (SecurityAction.Demand, ControlThread=true)]
622 public void Resume ()
629 [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
631 public static void SpinWait (int iterations)
633 throw new NotImplementedException ();
636 public void Start() {
637 // propagate informations from the original thread to the new thread
639 if (!ExecutionContext.IsFlowSuppressed ())
640 _ec = ExecutionContext.Capture ();
642 // before 2.0 this was only used for security (mostly CAS) so we
643 // do this only if the security manager is active
644 if (SecurityManager.SecurityEnabled)
645 _ec = ExecutionContext.Capture ();
647 if (CurrentThread._principal != null)
648 _principal = CurrentThread._principal;
650 // Thread_internal creates and starts the new thread,
651 if (Thread_internal(threadstart) == (IntPtr) 0)
652 throw new SystemException ("Thread creation failed.");
655 [MethodImplAttribute(MethodImplOptions.InternalCall)]
656 private extern void Suspend_internal();
661 [SecurityPermission (SecurityAction.Demand, ControlThread=true)]
662 public void Suspend ()
667 // Closes the system thread handle
668 [MethodImplAttribute(MethodImplOptions.InternalCall)]
669 private extern void Thread_free_internal(IntPtr handle);
672 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
675 // Free up the handle
676 if (system_thread_handle != (IntPtr) 0)
677 Thread_free_internal(system_thread_handle);
680 [MethodImplAttribute (MethodImplOptions.InternalCall)]
681 extern private void SetState (ThreadState set);
683 [MethodImplAttribute (MethodImplOptions.InternalCall)]
684 extern private void ClrState (ThreadState clr);
686 [MethodImplAttribute (MethodImplOptions.InternalCall)]
687 extern private ThreadState GetState ();
691 [MethodImplAttribute (MethodImplOptions.InternalCall)]
692 extern public static byte VolatileRead (ref byte address);
694 [MethodImplAttribute (MethodImplOptions.InternalCall)]
695 extern public static double VolatileRead (ref double address);
697 [MethodImplAttribute (MethodImplOptions.InternalCall)]
698 extern public static short VolatileRead (ref short address);
700 [MethodImplAttribute (MethodImplOptions.InternalCall)]
701 extern public static int VolatileRead (ref int address);
703 [MethodImplAttribute (MethodImplOptions.InternalCall)]
704 extern public static long VolatileRead (ref long address);
706 [MethodImplAttribute (MethodImplOptions.InternalCall)]
707 extern public static IntPtr VolatileRead (ref IntPtr address);
709 [MethodImplAttribute (MethodImplOptions.InternalCall)]
710 extern public static object VolatileRead (ref object address);
712 [CLSCompliant(false)]
713 [MethodImplAttribute (MethodImplOptions.InternalCall)]
714 extern public static sbyte VolatileRead (ref sbyte address);
716 [MethodImplAttribute (MethodImplOptions.InternalCall)]
717 extern public static float VolatileRead (ref float address);
719 [CLSCompliant (false)]
720 [MethodImplAttribute (MethodImplOptions.InternalCall)]
721 extern public static ushort VolatileRead (ref ushort address);
723 [CLSCompliant (false)]
724 [MethodImplAttribute (MethodImplOptions.InternalCall)]
725 extern public static uint VolatileRead (ref uint address);
727 [CLSCompliant (false)]
728 [MethodImplAttribute (MethodImplOptions.InternalCall)]
729 extern public static ulong VolatileRead (ref ulong address);
731 [CLSCompliant (false)]
732 [MethodImplAttribute (MethodImplOptions.InternalCall)]
733 extern public static UIntPtr VolatileRead (ref UIntPtr address);
735 [MethodImplAttribute (MethodImplOptions.InternalCall)]
736 extern public static void VolatileWrite (ref byte address, byte value);
738 [MethodImplAttribute (MethodImplOptions.InternalCall)]
739 extern public static void VolatileWrite (ref double address, double value);
741 [MethodImplAttribute (MethodImplOptions.InternalCall)]
742 extern public static void VolatileWrite (ref short address, short value);
744 [MethodImplAttribute (MethodImplOptions.InternalCall)]
745 extern public static void VolatileWrite (ref int address, int value);
747 [MethodImplAttribute (MethodImplOptions.InternalCall)]
748 extern public static void VolatileWrite (ref long address, long value);
750 [MethodImplAttribute (MethodImplOptions.InternalCall)]
751 extern public static void VolatileWrite (ref IntPtr address, IntPtr value);
753 [MethodImplAttribute (MethodImplOptions.InternalCall)]
754 extern public static void VolatileWrite (ref object address, object value);
756 [CLSCompliant(false)]
757 [MethodImplAttribute (MethodImplOptions.InternalCall)]
758 extern public static void VolatileWrite (ref sbyte address, sbyte value);
760 [MethodImplAttribute (MethodImplOptions.InternalCall)]
761 extern public static void VolatileWrite (ref float address, float value);
763 [CLSCompliant (false)]
764 [MethodImplAttribute (MethodImplOptions.InternalCall)]
765 extern public static void VolatileWrite (ref ushort address, ushort value);
767 [CLSCompliant (false)]
768 [MethodImplAttribute (MethodImplOptions.InternalCall)]
769 extern public static void VolatileWrite (ref uint address, uint value);
771 [CLSCompliant (false)]
772 [MethodImplAttribute (MethodImplOptions.InternalCall)]
773 extern public static void VolatileWrite (ref ulong address, ulong value);
775 [CLSCompliant (false)]
776 [MethodImplAttribute (MethodImplOptions.InternalCall)]
777 extern public static void VolatileWrite (ref UIntPtr address, UIntPtr value);
782 public Thread (ThreadStart start, int maxStackSize)
785 throw new ArgumentNullException ("start");
786 if (maxStackSize < 131072)
787 throw new ArgumentException ("< 128 kb", "maxStackSize");
790 stack_size = maxStackSize;
793 public Thread (ParameterizedThreadStart start)
796 throw new ArgumentNullException ("start");
801 public Thread (ParameterizedThreadStart start, int maxStackSize)
804 throw new ArgumentNullException ("start");
805 if (maxStackSize < 131072)
806 throw new ArgumentException ("< 128 kb", "maxStackSize");
809 stack_size = maxStackSize;
812 [MonoTODO ("limited to CompressedStack support")]
813 public ExecutionContext ExecutionContext {
814 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
817 _ec = new ExecutionContext ();
822 public int ManagedThreadId {
823 [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
824 get { return (int)thread_id; }
828 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
829 public static void BeginCriticalRegion ()
831 throw new NotImplementedException ();
835 [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
836 public static void EndCriticalRegion ()
838 throw new NotImplementedException ();
842 [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
843 public static void BeginThreadAffinity ()
845 throw new NotImplementedException ();
849 [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
850 public static void EndThreadAffinity ()
852 throw new NotImplementedException ();
856 // We disable warning 618, because we are accessing the
857 // empty property ApartmentState which produces an Obsolete
858 // message, but since its an empty routine needed for 1.x
861 // Maybe we should later turn these into internal methods for 1.x
862 // instead and have the property call these.
866 public ApartmentState GetApartmentState ()
868 return this.ApartmentState;
872 public void SetApartmentState (ApartmentState state)
874 this.ApartmentState = state;
878 public bool TrySetApartmentState (ApartmentState state)
881 this.ApartmentState = state;
884 catch (ArgumentException) {
893 public override int GetHashCode ()
895 // ??? overridden but not guaranteed to be unique ???
896 return (int)thread_id;
899 public void Start (object parameter)
901 start_obj = parameter;
905 internal ExecutionContext ExecutionContext {
908 _ec = new ExecutionContext ();
914 // NOTE: This method doesn't show in the class library status page because
915 // it cannot be "found" with the StrongNameIdentityPermission for ECMA key.
917 [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
918 [StrongNameIdentityPermission (SecurityAction.LinkDemand, PublicKey="00000000000000000400000000000000")]
920 [Obsolete ("see CompressedStack class")]
927 CompressedStack GetCompressedStack ()
929 // Note: returns null if no CompressedStack has been set.
930 // However CompressedStack.GetCompressedStack returns an
931 // (empty?) CompressedStack instance.
932 CompressedStack cs = ExecutionContext.SecurityContext.CompressedStack;
933 return ((cs == null) || cs.IsEmpty ()) ? null : cs.CreateCopy ();
936 // NOTE: This method doesn't show in the class library status page because
937 // it cannot be "found" with the StrongNameIdentityPermission for ECMA key.
939 [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
940 [StrongNameIdentityPermission (SecurityAction.LinkDemand, PublicKey="00000000000000000400000000000000")]
942 [Obsolete ("see CompressedStack class")]
949 void SetCompressedStack (CompressedStack stack)
951 ExecutionContext.SecurityContext.CompressedStack = stack;
955 void _Thread.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
957 throw new NotImplementedException ();
960 void _Thread.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
962 throw new NotImplementedException ();
965 void _Thread.GetTypeInfoCount (out uint pcTInfo)
967 throw new NotImplementedException ();
970 void _Thread.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
971 IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
973 throw new NotImplementedException ();