This commit is contained in:
Mikhail 2023-06-11 23:56:35 +08:00
parent 24f352facf
commit 4801a7a40b

View File

@ -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++)