add safety check tp preferLocal

This commit is contained in:
2026-05-02 22:00:56 +09:00
parent 54d0941e62
commit f8edb8ce4c
2 changed files with 5 additions and 1 deletions

View File

@@ -249,7 +249,7 @@ public sealed unsafe partial class JobScheduler : IDisposable
var tier = (int)jobInfo.priority;
var i = 0;
if (preferLocal)
if (preferLocal && WorkerThread.IsWorkerThread)
{
var index = WorkerThread.ThreadIndex;
for (; i < handleCount; i++)