Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Thread.cs
Go to the documentation of this file.
9
10namespace System.Threading;
11
12public sealed class Thread : CriticalFinalizerObject
13{
14 private sealed class StartHelper
15 {
16 internal int _maxStackSize;
17
18 internal Delegate _start;
19
20 internal object _startArg;
21
23
25
27
29
31 {
32 _start = start;
33 }
34
35 private static void Callback(object state)
36 {
37 ((StartHelper)state).RunWorker();
38 }
39
40 [MethodImpl(MethodImplOptions.AggressiveInlining)]
41 internal void Run()
42 {
44 {
46 }
47 else
48 {
49 RunWorker();
50 }
51 }
52
53 [MethodImpl(MethodImplOptions.AggressiveInlining)]
69
70 private void InitializeCulture()
71 {
72 if (_culture != null)
73 {
74 CultureInfo.CurrentCulture = _culture;
75 _culture = null;
76 }
77 if (_uiCulture != null)
78 {
79 CultureInfo.CurrentUICulture = _uiCulture;
80 _uiCulture = null;
81 }
82 }
83 }
84
85 private static class LocalDataStore
86 {
88
90 {
92 }
93
104
115
116 public static LocalDataStoreSlot GetNamedSlot(string name)
117 {
120 {
121 if (!dictionary.TryGetValue(name, out var value))
122 {
123 value = (dictionary[name] = AllocateSlot());
124 }
125 return value;
126 }
127 }
128
129 public static void FreeNamedSlot(string name)
130 {
133 {
134 dictionary.Remove(name);
135 }
136 }
137
139 {
140 if (slot == null)
141 {
142 throw new ArgumentNullException("slot");
143 }
144 return slot.Data;
145 }
146
147 public static object GetData(LocalDataStoreSlot slot)
148 {
149 return GetThreadLocal(slot).Value;
150 }
151
152 public static void SetData(LocalDataStoreSlot slot, object value)
153 {
154 GetThreadLocal(slot).Value = value;
155 }
156 }
157
159
161
162 private string _name;
163
165
167
168 private int _priority;
169
170 private int _managedThreadId;
171
173
175
177
179 private static Thread t_currentThread;
180
181 public extern int ManagedThreadId
182 {
183 [MethodImpl(MethodImplOptions.InternalCall)]
184 [Intrinsic]
185 get;
186 }
187
188 public extern bool IsAlive
189 {
190 [MethodImpl(MethodImplOptions.InternalCall)]
191 get;
192 }
193
194 public bool IsBackground
195 {
196 get
197 {
198 return IsBackgroundNative();
199 }
200 set
201 {
203 if (!value)
204 {
206 }
207 }
208 }
209
210 public extern bool IsThreadPoolThread
211 {
212 [MethodImpl(MethodImplOptions.InternalCall)]
213 get;
214 [MethodImpl(MethodImplOptions.InternalCall)]
215 internal set;
216 }
217
219 {
220 get
221 {
223 }
224 set
225 {
227 if (value != ThreadPriority.Normal)
228 {
230 }
231 }
232 }
233
235
236 internal static extern int OptimalMaxSpinWaitsPerSpinIteration
237 {
238 [MethodImpl(MethodImplOptions.InternalCall)]
240 get;
241 }
242
243 [UnsupportedOSPlatformGuard("browser")]
244 internal static bool IsThreadStartSupported => true;
245
247 {
248 get
249 {
252 }
253 set
254 {
255 if (this != CurrentThread)
256 {
258 }
259 else
260 {
261 CultureInfo.CurrentCulture = value;
262 }
263 }
264 }
265
267 {
268 get
269 {
272 }
273 set
274 {
275 if (this != CurrentThread)
276 {
278 }
279 else
280 {
281 CultureInfo.CurrentUICulture = value;
282 }
283 }
284 }
285
287 {
288 get
289 {
291 if (principal == null)
292 {
293 principal = (CurrentPrincipal = AppDomain.CurrentDomain.GetThreadPrincipal());
294 }
295 return principal;
296 }
297 set
298 {
299 if (s_asyncLocalPrincipal == null)
300 {
301 if (value == null)
302 {
303 return;
304 }
306 }
307 s_asyncLocalPrincipal.Value = value;
308 }
309 }
310
311 public static Thread CurrentThread
312 {
313 [Intrinsic]
314 get
315 {
317 }
318 }
319
320 internal static ulong CurrentOSThreadId => GetCurrentOSThreadId();
321
323
324 public string? Name
325 {
326 get
327 {
328 return _name;
329 }
330 set
331 {
332 lock (this)
333 {
334 if (_name != value)
335 {
336 _name = value;
339 }
340 }
341 }
342 }
343
344 [Obsolete("The ApartmentState property has been deprecated. Use GetApartmentState, SetApartmentState or TrySetApartmentState.")]
346 {
347 get
348 {
349 return GetApartmentState();
350 }
351 set
352 {
354 }
355 }
356
357 private Thread()
358 {
359 }
360
370
371 private unsafe void StartCore()
372 {
373 lock (this)
374 {
375 fixed (char* pThreadName = _name)
376 {
378 }
379 }
380 }
381
382 [DllImport("QCall")]
383 private unsafe static extern void StartInternal(ThreadHandle t, int stackSize, int priority, char* pThreadName);
384
385 private void StartCallback()
386 {
388 _startHelper = null;
389 startHelper.Run();
390 }
391
392 [MethodImpl(MethodImplOptions.InternalCall)]
393 private static extern IntPtr InternalGetCurrentThread();
394
395 [MethodImpl(MethodImplOptions.InternalCall)]
396 private static extern void SleepInternal(int millisecondsTimeout);
397
398 [DllImport("QCall")]
399 internal static extern void UninterruptibleSleep0();
400
401 [MethodImpl(MethodImplOptions.InternalCall)]
402 private static extern void SpinWaitInternal(int iterations);
403
404 public static void SpinWait(int iterations)
405 {
407 }
408
409 [DllImport("QCall", CharSet = CharSet.Unicode)]
410 private static extern Interop.BOOL YieldInternal();
411
412 public static bool Yield()
413 {
414 return YieldInternal() != Interop.BOOL.FALSE;
415 }
416
417 [MethodImpl(MethodImplOptions.NoInlining)]
419 {
421 }
422
423 [MethodImpl(MethodImplOptions.InternalCall)]
424 private static extern Thread GetCurrentThreadNative();
425
426 [MethodImpl(MethodImplOptions.InternalCall)]
427 private extern void Initialize();
428
430 {
432 }
433
434 [MethodImpl(MethodImplOptions.InternalCall)]
435 private extern void InternalFinalize();
436
437 [DllImport("QCall", CharSet = CharSet.Unicode)]
438 private static extern void InformThreadNameChange(ThreadHandle t, string name, int len);
439
440 [MethodImpl(MethodImplOptions.InternalCall)]
441 private extern bool IsBackgroundNative();
442
443 [MethodImpl(MethodImplOptions.InternalCall)]
444 private extern void SetBackgroundNative(bool isBackground);
445
446 [MethodImpl(MethodImplOptions.InternalCall)]
447 private extern int GetPriorityNative();
448
449 [MethodImpl(MethodImplOptions.InternalCall)]
450 private extern void SetPriorityNative(int priority);
451
452 [DllImport("QCall")]
453 private static extern ulong GetCurrentOSThreadId();
454
455 [MethodImpl(MethodImplOptions.InternalCall)]
456 private extern int GetThreadStateNative();
457
462
464 {
466 if (state == ApartmentState.Unknown && apartmentState == ApartmentState.MTA)
467 {
468 return true;
469 }
470 if (apartmentState != state)
471 {
472 if (throwOnError)
473 {
475 throw new InvalidOperationException(message);
476 }
477 return false;
478 }
479 return true;
480 }
481
482 [MethodImpl(MethodImplOptions.InternalCall)]
483 internal extern int GetApartmentStateNative();
484
485 [MethodImpl(MethodImplOptions.InternalCall)]
486 internal extern int SetApartmentStateNative(int state);
487
488 [MethodImpl(MethodImplOptions.InternalCall)]
489 public extern void DisableComObjectEagerCleanup();
490
491 [MethodImpl(MethodImplOptions.InternalCall)]
492 public extern void Interrupt();
493
494 [MethodImpl(MethodImplOptions.InternalCall)]
495 public extern bool Join(int millisecondsTimeout);
496
497 [MethodImpl(MethodImplOptions.InternalCall)]
498 internal static extern int GetCurrentProcessorNumber();
499
500 [MethodImpl(MethodImplOptions.AggressiveInlining)]
501 public static int GetCurrentProcessorId()
502 {
504 {
506 }
508 }
509
510 [MethodImpl(MethodImplOptions.AggressiveInlining)]
518
520 {
521 if (start == null)
522 {
523 throw new ArgumentNullException("start");
524 }
526 Initialize();
527 }
528
530 {
531 if (start == null)
532 {
533 throw new ArgumentNullException("start");
534 }
535 if (maxStackSize < 0)
536 {
538 }
540 {
541 _maxStackSize = maxStackSize
542 };
543 Initialize();
544 }
545
547 {
548 if (start == null)
549 {
550 throw new ArgumentNullException("start");
551 }
553 Initialize();
554 }
555
557 {
558 if (start == null)
559 {
560 throw new ArgumentNullException("start");
561 }
562 if (maxStackSize < 0)
563 {
565 }
567 {
568 _maxStackSize = maxStackSize
569 };
570 Initialize();
571 }
572
573 [UnsupportedOSPlatform("browser")]
574 public void Start(object? parameter)
575 {
577 }
578
579 [UnsupportedOSPlatform("browser")]
580 public void UnsafeStart(object? parameter)
581 {
583 }
584
585 private void Start(object parameter, bool captureContext)
586 {
588 if (startHelper != null)
589 {
590 if (startHelper._start is ThreadStart)
591 {
593 }
594 startHelper._startArg = parameter;
595 startHelper._executionContext = (captureContext ? System.Threading.ExecutionContext.Capture() : null);
596 }
597 StartCore();
598 }
599
600 [UnsupportedOSPlatform("browser")]
601 public void Start()
602 {
603 Start(captureContext: true);
604 }
605
606 [UnsupportedOSPlatform("browser")]
607 public void UnsafeStart()
608 {
609 Start(captureContext: false);
610 }
611
612 private void Start(bool captureContext)
613 {
615 if (startHelper != null)
616 {
617 startHelper._startArg = null;
618 startHelper._executionContext = (captureContext ? System.Threading.ExecutionContext.Capture() : null);
619 }
620 StartCore();
621 }
622
623 private void RequireCurrentThread()
624 {
625 if (this != CurrentThread)
626 {
628 }
629 }
630
632 {
633 if (value == null)
634 {
635 throw new ArgumentNullException("value");
636 }
638 if ((ThreadState & ThreadState.Unstarted) == 0)
639 {
641 }
642 if (uiCulture)
643 {
644 startHelper._uiCulture = value;
645 }
646 else
647 {
648 startHelper._culture = value;
649 }
650 }
651
652 private void ThreadNameChanged(string value)
653 {
655 }
656
657 [MethodImpl(MethodImplOptions.NoInlining)]
658 public static void Sleep(int millisecondsTimeout)
659 {
660 if (millisecondsTimeout < -1)
661 {
663 }
665 }
666
668 {
669 lock (this)
670 {
671 _name = ".NET ThreadPool Worker";
672 ThreadNameChanged(".NET ThreadPool Worker");
673 }
674 }
675
676 [MethodImpl(MethodImplOptions.NoInlining)]
678 {
680 if (_name != ".NET ThreadPool Worker")
681 {
683 }
684 if (!IsBackground)
685 {
686 IsBackground = true;
687 }
688 if (Priority != ThreadPriority.Normal)
689 {
690 Priority = ThreadPriority.Normal;
691 }
692 }
693
694 [Obsolete("Thread.Abort is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0006", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
699
700 [Obsolete("Thread.Abort is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0006", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
701 public void Abort(object? stateInfo)
702 {
704 }
705
706 [Obsolete("Thread.Abort is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0006", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
707 public static void ResetAbort()
708 {
710 }
711
712 [Obsolete("Thread.Suspend has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.")]
717
718 [Obsolete("Thread.Resume has been deprecated. Use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources.")]
723
724 public static void BeginCriticalRegion()
725 {
726 }
727
728 public static void EndCriticalRegion()
729 {
730 }
731
732 public static void BeginThreadAffinity()
733 {
734 }
735
736 public static void EndThreadAffinity()
737 {
738 }
739
741 {
743 }
744
745 public static LocalDataStoreSlot AllocateNamedDataSlot(string name)
746 {
748 }
749
750 public static LocalDataStoreSlot GetNamedDataSlot(string name)
751 {
752 return LocalDataStore.GetNamedSlot(name);
753 }
754
755 public static void FreeNamedDataSlot(string name)
756 {
758 }
759
760 public static object? GetData(LocalDataStoreSlot slot)
761 {
763 }
764
765 public static void SetData(LocalDataStoreSlot slot, object? data)
766 {
768 }
769
770 [SupportedOSPlatform("windows")]
775
777 {
778 return SetApartmentState(state, throwOnError: false);
779 }
780
782 {
783 if ((uint)state > 2u)
784 {
786 }
788 }
789
790 [Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
795
796 [Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
801
802 public static AppDomain GetDomain()
803 {
805 }
806
807 public static int GetDomainID()
808 {
809 return 1;
810 }
811
812 public override int GetHashCode()
813 {
814 return ManagedThreadId;
815 }
816
817 public void Join()
818 {
819 Join(-1);
820 }
821
822 public bool Join(TimeSpan timeout)
823 {
825 }
826
827 public static void MemoryBarrier()
828 {
830 }
831
832 public static void Sleep(TimeSpan timeout)
833 {
835 }
836
837 public static byte VolatileRead(ref byte address)
838 {
839 return Volatile.Read(ref address);
840 }
841
842 public static double VolatileRead(ref double address)
843 {
844 return Volatile.Read(ref address);
845 }
846
847 public static short VolatileRead(ref short address)
848 {
849 return Volatile.Read(ref address);
850 }
851
852 public static int VolatileRead(ref int address)
853 {
854 return Volatile.Read(ref address);
855 }
856
857 public static long VolatileRead(ref long address)
858 {
859 return Volatile.Read(ref address);
860 }
861
862 public static IntPtr VolatileRead(ref IntPtr address)
863 {
864 return Volatile.Read(ref address);
865 }
866
867 [return: NotNullIfNotNull("address")]
868 public static object? VolatileRead([NotNullIfNotNull("address")] ref object? address)
869 {
870 return Volatile.Read(ref address);
871 }
872
873 [CLSCompliant(false)]
874 public static sbyte VolatileRead(ref sbyte address)
875 {
876 return Volatile.Read(ref address);
877 }
878
879 public static float VolatileRead(ref float address)
880 {
881 return Volatile.Read(ref address);
882 }
883
884 [CLSCompliant(false)]
885 public static ushort VolatileRead(ref ushort address)
886 {
887 return Volatile.Read(ref address);
888 }
889
890 [CLSCompliant(false)]
891 public static uint VolatileRead(ref uint address)
892 {
893 return Volatile.Read(ref address);
894 }
895
896 [CLSCompliant(false)]
897 public static ulong VolatileRead(ref ulong address)
898 {
899 return Volatile.Read(ref address);
900 }
901
902 [CLSCompliant(false)]
903 public static UIntPtr VolatileRead(ref UIntPtr address)
904 {
905 return Volatile.Read(ref address);
906 }
907
908 public static void VolatileWrite(ref byte address, byte value)
909 {
910 Volatile.Write(ref address, value);
911 }
912
913 public static void VolatileWrite(ref double address, double value)
914 {
915 Volatile.Write(ref address, value);
916 }
917
918 public static void VolatileWrite(ref short address, short value)
919 {
920 Volatile.Write(ref address, value);
921 }
922
923 public static void VolatileWrite(ref int address, int value)
924 {
925 Volatile.Write(ref address, value);
926 }
927
928 public static void VolatileWrite(ref long address, long value)
929 {
930 Volatile.Write(ref address, value);
931 }
932
933 public static void VolatileWrite(ref IntPtr address, IntPtr value)
934 {
935 Volatile.Write(ref address, value);
936 }
937
938 public static void VolatileWrite([NotNullIfNotNull("value")] ref object? address, object? value)
939 {
940 Volatile.Write(ref address, value);
941 }
942
943 [CLSCompliant(false)]
944 public static void VolatileWrite(ref sbyte address, sbyte value)
945 {
946 Volatile.Write(ref address, value);
947 }
948
949 public static void VolatileWrite(ref float address, float value)
950 {
951 Volatile.Write(ref address, value);
952 }
953
954 [CLSCompliant(false)]
955 public static void VolatileWrite(ref ushort address, ushort value)
956 {
957 Volatile.Write(ref address, value);
958 }
959
960 [CLSCompliant(false)]
961 public static void VolatileWrite(ref uint address, uint value)
962 {
963 Volatile.Write(ref address, value);
964 }
965
966 [CLSCompliant(false)]
967 public static void VolatileWrite(ref ulong address, ulong value)
968 {
969 Volatile.Write(ref address, value);
970 }
971
972 [CLSCompliant(false)]
973 public static void VolatileWrite(ref UIntPtr address, UIntPtr value)
974 {
975 Volatile.Write(ref address, value);
976 }
977}
static AppDomain CurrentDomain
Definition AppDomain.cs:28
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static CultureInfo CurrentUICulture
static CultureInfo CurrentCulture
static string InvalidOperation_ThreadWrongThreadStart
Definition SR.cs:1518
static string PlatformNotSupported_ThreadAbort
Definition SR.cs:1810
static string PlatformNotSupported_ThreadSuspend
Definition SR.cs:1812
static string ArgumentOutOfRange_Enum
Definition SR.cs:18
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ArgumentOutOfRange_NeedNonNegOrNegative1
Definition SR.cs:1072
static string Thread_ApartmentState_ChangeFailed
Definition SR.cs:1986
static string Argument_InvalidHandle
Definition SR.cs:24
static string Thread_Operation_RequiresCurrentThread
Definition SR.cs:1990
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
static string Thread_GetSetCompressedStack_NotSupported
Definition SR.cs:1988
Definition SR.cs:7
static void RunInternal(ExecutionContext executionContext, ContextCallback callback, object state)
static ? ExecutionContext Capture()
static int CompareExchange(ref int location1, int value, int comparand)
static readonly bool UsePortableThreadPool
Definition ThreadPool.cs:12
static void FreeNamedSlot(string name)
Definition Thread.cs:129
static LocalDataStoreSlot GetNamedSlot(string name)
Definition Thread.cs:116
static Dictionary< string, LocalDataStoreSlot > s_nameToSlotMap
Definition Thread.cs:87
static LocalDataStoreSlot AllocateNamedSlot(string name)
Definition Thread.cs:105
static void SetData(LocalDataStoreSlot slot, object value)
Definition Thread.cs:152
static LocalDataStoreSlot AllocateSlot()
Definition Thread.cs:89
static object GetData(LocalDataStoreSlot slot)
Definition Thread.cs:147
static ThreadLocal< object > GetThreadLocal(LocalDataStoreSlot slot)
Definition Thread.cs:138
static Dictionary< string, LocalDataStoreSlot > EnsureNameToSlotMap()
Definition Thread.cs:94
static readonly ContextCallback s_threadStartContextCallback
Definition Thread.cs:28
static void Callback(object state)
Definition Thread.cs:35
ExecutionContext _executionContext
Definition Thread.cs:26
static ushort VolatileRead(ref ushort address)
Definition Thread.cs:885
static void VolatileWrite(ref IntPtr address, IntPtr value)
Definition Thread.cs:933
static ulong GetCurrentOSThreadId()
static int OptimalMaxSpinWaitsPerSpinIteration
Definition Thread.cs:237
static void ResetAbort()
Definition Thread.cs:707
static bool Yield()
Definition Thread.cs:412
static readonly bool s_isProcessorNumberReallyFast
Definition Thread.cs:174
SynchronizationContext _synchronizationContext
Definition Thread.cs:160
static uint VolatileRead(ref uint address)
Definition Thread.cs:891
void Start(bool captureContext)
Definition Thread.cs:612
static byte VolatileRead(ref byte address)
Definition Thread.cs:837
static Thread InitializeCurrentThread()
Definition Thread.cs:418
static ? object GetData(LocalDataStoreSlot slot)
Definition Thread.cs:760
bool TrySetApartmentState(ApartmentState state)
Definition Thread.cs:776
static void VolatileWrite([NotNullIfNotNull("value")] ref object? address, object? value)
Definition Thread.cs:938
static void Sleep(int millisecondsTimeout)
Definition Thread.cs:658
bool Join(TimeSpan timeout)
Definition Thread.cs:822
static void SetData(LocalDataStoreSlot slot, object? data)
Definition Thread.cs:765
bool _mayNeedResetForThreadPool
Definition Thread.cs:172
Thread(ParameterizedThreadStart start)
Definition Thread.cs:546
void SetBackgroundNative(bool isBackground)
void Abort(object? stateInfo)
Definition Thread.cs:701
static void VolatileWrite(ref uint address, uint value)
Definition Thread.cs:961
static long VolatileRead(ref long address)
Definition Thread.cs:857
void RequireCurrentThread()
Definition Thread.cs:623
void SetApartmentState(ApartmentState state)
Definition Thread.cs:771
static void InformThreadNameChange(ThreadHandle t, string name, int len)
static void VolatileWrite(ref ushort address, ushort value)
Definition Thread.cs:955
static bool IsThreadStartSupported
Definition Thread.cs:244
bool SetApartmentStateUnchecked(ApartmentState state, bool throwOnError)
Definition Thread.cs:463
static IntPtr InternalGetCurrentThread()
void SetCultureOnUnstartedThread(CultureInfo value, bool uiCulture)
Definition Thread.cs:631
static sbyte VolatileRead(ref sbyte address)
Definition Thread.cs:874
static void VolatileWrite(ref float address, float value)
Definition Thread.cs:949
Thread(ParameterizedThreadStart start, int maxStackSize)
Definition Thread.cs:556
static LocalDataStoreSlot AllocateDataSlot()
Definition Thread.cs:740
void SetPriorityNative(int priority)
static void EndCriticalRegion()
Definition Thread.cs:728
static ulong VolatileRead(ref ulong address)
Definition Thread.cs:897
static double VolatileRead(ref double address)
Definition Thread.cs:842
ApartmentState ApartmentState
Definition Thread.cs:346
override int GetHashCode()
Definition Thread.cs:812
static void VolatileWrite(ref sbyte address, sbyte value)
Definition Thread.cs:944
static void VolatileWrite(ref double address, double value)
Definition Thread.cs:913
static void FreeNamedDataSlot(string name)
Definition Thread.cs:755
void Start(object parameter, bool captureContext)
Definition Thread.cs:585
ApartmentState GetApartmentState()
Definition Thread.cs:458
void ThreadNameChanged(string value)
Definition Thread.cs:652
bool Join(int millisecondsTimeout)
static int VolatileRead(ref int address)
Definition Thread.cs:852
Thread(ThreadStart start)
Definition Thread.cs:519
static unsafe void StartInternal(ThreadHandle t, int stackSize, int priority, char *pThreadName)
unsafe void StartCore()
Definition Thread.cs:371
static ulong CurrentOSThreadId
Definition Thread.cs:320
ThreadPriority Priority
Definition Thread.cs:219
static void EndThreadAffinity()
Definition Thread.cs:736
static Thread CurrentThread
Definition Thread.cs:312
static Thread t_currentThread
Definition Thread.cs:179
static void VolatileWrite(ref byte address, byte value)
Definition Thread.cs:908
static void VolatileWrite(ref UIntPtr address, UIntPtr value)
Definition Thread.cs:973
static void MemoryBarrier()
Definition Thread.cs:827
static Thread GetCurrentThreadNative()
ThreadHandle GetNativeHandle()
Definition Thread.cs:361
static LocalDataStoreSlot AllocateNamedDataSlot(string name)
Definition Thread.cs:745
static UIntPtr VolatileRead(ref UIntPtr address)
Definition Thread.cs:903
static int GetDomainID()
Definition Thread.cs:807
static ? IPrincipal CurrentPrincipal
Definition Thread.cs:287
ThreadState ThreadState
Definition Thread.cs:234
static IntPtr VolatileRead(ref IntPtr address)
Definition Thread.cs:862
static void SleepInternal(int millisecondsTimeout)
static void SpinWaitInternal(int iterations)
int SetApartmentStateNative(int state)
void DisableComObjectEagerCleanup()
IntPtr _DONT_USE_InternalThread
Definition Thread.cs:166
void ResetThreadPoolThread()
Definition Thread.cs:511
ExecutionContext _executionContext
Definition Thread.cs:158
static ? object VolatileRead([NotNullIfNotNull("address")] ref object? address)
Definition Thread.cs:868
static short VolatileRead(ref short address)
Definition Thread.cs:847
static AppDomain GetDomain()
Definition Thread.cs:802
void Start(object? parameter)
Definition Thread.cs:574
static void Sleep(TimeSpan timeout)
Definition Thread.cs:832
StartHelper _startHelper
Definition Thread.cs:164
bool SetApartmentState(ApartmentState state, bool throwOnError)
Definition Thread.cs:781
void SetCompressedStack(CompressedStack stack)
Definition Thread.cs:797
Thread(ThreadStart start, int maxStackSize)
Definition Thread.cs:529
void SetThreadPoolWorkerThreadName()
Definition Thread.cs:667
CultureInfo CurrentCulture
Definition Thread.cs:247
static void VolatileWrite(ref ulong address, ulong value)
Definition Thread.cs:967
static float VolatileRead(ref float address)
Definition Thread.cs:879
static void VolatileWrite(ref long address, long value)
Definition Thread.cs:928
CultureInfo CurrentUICulture
Definition Thread.cs:267
static int GetCurrentProcessorId()
Definition Thread.cs:501
static int GetCurrentProcessorNumber()
static Interop.BOOL YieldInternal()
static LocalDataStoreSlot GetNamedDataSlot(string name)
Definition Thread.cs:750
CompressedStack GetCompressedStack()
Definition Thread.cs:791
void ResetThreadPoolThreadSlow()
Definition Thread.cs:677
static void SpinWait(int iterations)
Definition Thread.cs:404
static void UninterruptibleSleep0()
void UnsafeStart(object? parameter)
Definition Thread.cs:580
static void VolatileWrite(ref int address, int value)
Definition Thread.cs:923
static void BeginThreadAffinity()
Definition Thread.cs:732
static void BeginCriticalRegion()
Definition Thread.cs:724
static void VolatileWrite(ref short address, short value)
Definition Thread.cs:918
static AsyncLocal< IPrincipal > s_asyncLocalPrincipal
Definition Thread.cs:176
static bool Read(ref bool location)
Definition Volatile.cs:67
static void Write(ref bool location, bool value)
Definition Volatile.cs:74
static int ToTimeoutMilliseconds(TimeSpan timeout)
Definition WaitHandle.cs:93
delegate void ThreadStart()
delegate void ContextCallback(object? state)
delegate void ParameterizedThreadStart(object? obj)
static readonly IntPtr Zero
Definition IntPtr.cs:18