fixes for support Unity 2020.1.x

This commit is contained in:
Mikhail 2024-01-04 22:52:12 +08:00
parent 908b6328cd
commit db29061ccb

View File

@ -18,6 +18,8 @@ namespace DCFApixels.DragonECS
private static bool _isRunning = false;
private static object _lock = new object();
private static void ThreadProc(object obj)
{
int i = (int)obj;
@ -117,9 +119,12 @@ namespace DCFApixels.DragonECS
_worker = _nullWorker;
if (_catchedExceptions.Count > 0)
{
Exception[] exceptions = _catchedExceptions.ToArray();
_catchedExceptions.Clear();
throw new AggregateException(exceptions);
lock (_lock)
{
Exception[] exceptions = _catchedExceptions.ToArray();
_catchedExceptions = new ConcurrentQueue<Exception>();
throw new AggregateException(exceptions);
}
}
}