diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-02-11 04:07:33 +0300 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2016-02-11 04:07:33 +0300 |
commit | 85722b244058ebc66310febc01d1106427d8c447 (patch) | |
tree | bb9fbf08e472cc8210b531bcc4a23075fa38b8cc /src/Native/Runtime/startup.cpp | |
parent | dfa6113d42e14ccbf3f152220777bff7a0c0c90e (diff) | |
parent | 8d00b434b2c7cc0b7a9cb1eb0a57006ae9c76ace (diff) |
Merge pull request #832 from janvorli/thread-exit-callback
Refactor explicit FLS usage in the runtime
Diffstat (limited to 'src/Native/Runtime/startup.cpp')
-rw-r--r-- | src/Native/Runtime/startup.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/Native/Runtime/startup.cpp b/src/Native/Runtime/startup.cpp index 29289a694..9a56bf775 100644 --- a/src/Native/Runtime/startup.cpp +++ b/src/Native/Runtime/startup.cpp @@ -39,7 +39,6 @@ UInt32 _fls_index = FLS_OUT_OF_INDEXES; Int32 __stdcall RhpVectoredExceptionHandler(PEXCEPTION_POINTERS pExPtrs); -void __stdcall FiberDetach(void* lpFlsData); void CheckForPalFallback(); void DetectCPUFeatures(); @@ -77,10 +76,6 @@ bool InitDLL(HANDLE hPalInstance) return false; STARTUP_TIMELINE_EVENT(NONGC_INIT_COMPLETE); - _fls_index = PalFlsAlloc(FiberDetach); - if (_fls_index == FLS_OUT_OF_INDEXES) - return false; - // @TODO: currently we're always forcing a workstation GC. // @TODO: GC per-instance vs per-DLL state separation if (!RedhawkGCInterface::InitializeSubsystems(RedhawkGCInterface::GCType_Workstation)) @@ -244,13 +239,13 @@ void DllThreadDetach() } } -void __stdcall FiberDetach(void* lpFlsData) +void __stdcall RuntimeThreadShutdown(void* thread) { // Note: loader lock is *not* held here! - UNREFERENCED_PARAMETER(lpFlsData); - ASSERT(lpFlsData == PalFlsGetValue(_fls_index)); + UNREFERENCED_PARAMETER(thread); + ASSERT((Thread*)thread == ThreadStore::GetCurrentThread()); - ThreadStore::DetachCurrentThreadIfHomeFiber(); + ThreadStore::DetachCurrentThread(); } COOP_PINVOKE_HELPER(UInt32_BOOL, RhpRegisterModule, (ModuleHeader *pModuleHeader)) |