Skip to content

Commit 18e3acf

Browse files
VSadovgithub-actions
authored and
github-actions
committed
InitFlsSlot throws per convention used in threading initialization
1 parent 37a141e commit 18e3acf

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/coreclr/vm/ceemain.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,17 +1764,16 @@ static void __stdcall FiberDetachCallback(void* lpFlsData)
17641764
}
17651765
}
17661766

1767-
bool InitFlsSlot()
1767+
void InitFlsSlot()
17681768
{
17691769
// We use fiber detach callbacks to run our thread shutdown code because the fiber detach
17701770
// callback is made without the OS loader lock
17711771
g_flsIndex = FlsAlloc(FiberDetachCallback);
17721772
if (g_flsIndex == FLS_OUT_OF_INDEXES)
17731773
{
1774-
return false;
1774+
_ASSERTE(!"Initialization of an FLS slot failed.");
1775+
COMPlusThrowWin32();
17751776
}
1776-
1777-
return true;
17781777
}
17791778

17801779
// Register the thread with OS to be notified when thread is about to be destroyed

src/coreclr/vm/ceemain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void ThreadDetaching();
4747

4848
void EnsureTlsDestructionMonitor();
4949
#ifdef TARGET_WINDOWS
50-
bool InitFlsSlot();
50+
void InitFlsSlot();
5151
bool OsDetachThread(void* thread);
5252
#endif
5353

src/coreclr/vm/threads.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,10 +1075,7 @@ void InitThreadManager()
10751075
CONTRACTL_END;
10761076

10771077
#ifdef TARGET_WINDOWS
1078-
if (!InitFlsSlot())
1079-
{
1080-
_ASSERTE_ALL_BUILDS(!"Initialization of a FLS slot failed.");
1081-
}
1078+
InitFlsSlot();
10821079
#endif
10831080

10841081
// All patched helpers should fit into one page.

0 commit comments

Comments
 (0)