Fix ThreadLocal when thread count limit is low on a target platform or if it's only main-thread

This commit is contained in:
Wojtek Figat
2026-02-16 11:59:12 +01:00
parent 25e90deed6
commit 3d206e06d0
2 changed files with 61 additions and 4 deletions

View File

@@ -75,7 +75,7 @@ public:
namespace
{
JobSystemService JobSystemInstance;
Thread* Threads[PLATFORM_THREADS_LIMIT / 2] = {};
Thread* Threads[(PLATFORM_THREADS_LIMIT + 1) / 2] = {};
int32 ThreadsCount = 0;
bool JobStartingOnDispatch = true;
volatile int64 ExitFlag = 0;