add try catch block in thread

This commit is contained in:
Mikhail 2023-06-12 01:16:00 +08:00
parent 893313990a
commit 10bad36486

View File

@ -15,17 +15,22 @@ namespace DCFApixels.DragonECS
private static void ThreadProc(object obj)
{
ref ThreadReacord record = ref _threads[(int)obj];
//try
//{
while (Thread.CurrentThread.IsAlive)
while (Thread.CurrentThread.IsAlive)
{
try
{
record.runWork.WaitOne();
record.runWork.Reset();
_worker.Invoke(new ReadOnlySpan<int>(_entities, record.start, record.size));
record.doneWork.Set();
}
//}
//catch { }
catch (Exception)
{
record.doneWork.Set();
throw;
}
}
}
static ThreadRunner()