mirror of
https://github.com/DCFApixels/DragonECS-ClassicThreads.git
synced 2025-09-18 11:54:34 +08:00
fix
This commit is contained in:
parent
24f352facf
commit
4801a7a40b
@ -21,7 +21,6 @@ namespace DCFApixels.DragonECS
|
|||||||
record.runWork.WaitOne();
|
record.runWork.WaitOne();
|
||||||
record.runWork.Reset();
|
record.runWork.Reset();
|
||||||
_worker.Invoke(new ReadOnlySpan<int>(_entities, record.start, record.size));
|
_worker.Invoke(new ReadOnlySpan<int>(_entities, record.start, record.size));
|
||||||
|
|
||||||
record.doneWork.Set();
|
record.doneWork.Set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,7 +65,7 @@ namespace DCFApixels.DragonECS
|
|||||||
thread.start = i * spanSize;
|
thread.start = i * spanSize;
|
||||||
thread.size = spanSize;
|
thread.size = spanSize;
|
||||||
}
|
}
|
||||||
_threads[^1].size = entities.Count % (threadsCount - 1);
|
_threads[threadsCount - 1].size = entities.Count % (threadsCount - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -79,7 +78,7 @@ namespace DCFApixels.DragonECS
|
|||||||
for (int i = 0; i < threadsCount; i++)
|
for (int i = 0; i < threadsCount; i++)
|
||||||
{
|
{
|
||||||
ref var thread = ref _threads[i];
|
ref var thread = ref _threads[i];
|
||||||
thread.runWork.Reset();
|
thread.doneWork.Reset();
|
||||||
thread.runWork.Set();
|
thread.runWork.Set();
|
||||||
}
|
}
|
||||||
for (int i = 0; i < threadsCount; i++)
|
for (int i = 0; i < threadsCount; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user