internal static unsafe void FinishInitializeThread() { int threadIndex = initialThread.threadIndex; // Get the GC ready for initialThread Transitions.RuntimeInitialized(); Transitions.ThreadStart(); initialThread.processGcEvent = new AutoResetEvent(false); initialThread.autoEvent = new AutoResetEvent(false); initialThread.joinEvent = new ManualResetEvent(false); initialThread.singleQueueItem = new ThreadQueueItem [1] { new ThreadQueueItem(initialThread) }; // Use CurrentThread to find our initial handle: VTable.Assert(initialThread == CurrentThread); initialThread.threadHandle = ThreadHandle.CurrentThread(); // Instantiate the static variable that needs to be initialized m_LocalDataStoreMgr = new LocalDataStoreMgr(); AddThread(threadIndex); }