mirror of
https://github.com/DCFApixels/DragonECS-ClassicThreads.git
synced 2025-09-18 03:44:34 +08:00
update exceptions
This commit is contained in:
parent
19108fbb41
commit
e0ec9c310f
12
src/Exceptions.cs
Normal file
12
src/Exceptions.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace DCFApixels.DragonECS
|
||||||
|
{
|
||||||
|
public static class EcsThrowHalper_ClassicThreads
|
||||||
|
{
|
||||||
|
internal static void DoubleParallelIteration(this EcsThrowHalper _)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("It is forbidden to start a parallel iteration before the last one is finished.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
src/Exceptions.cs.meta
Normal file
11
src/Exceptions.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dc7a8620fe24fe14f892ee3f82918c94
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using static DCFApixels.DragonECS.EcsThrowHalper;
|
||||||
|
|
||||||
namespace DCFApixels.DragonECS
|
namespace DCFApixels.DragonECS
|
||||||
{
|
{
|
||||||
@ -61,8 +62,7 @@ namespace DCFApixels.DragonECS
|
|||||||
public static void Run(EcsThreadHandler worker, EcsReadonlyGroup entities, int minSpanSize)
|
public static void Run(EcsThreadHandler worker, EcsReadonlyGroup entities, int minSpanSize)
|
||||||
{
|
{
|
||||||
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
if (_isRunning)
|
if (_isRunning) Throw.DoubleParallelIteration();
|
||||||
throw new InvalidOperationException("It is forbidden to start a parallel iteration before the last one is finished.");
|
|
||||||
#endif
|
#endif
|
||||||
_isRunning = true;
|
_isRunning = true;
|
||||||
_worker = worker;
|
_worker = worker;
|
||||||
@ -116,7 +116,7 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
var exceptions = _catchedExceptions;
|
var exceptions = _catchedExceptions;
|
||||||
_catchedExceptions = null;
|
_catchedExceptions = null;
|
||||||
throw new AggregateException("Mutiplie exceptions", exceptions);
|
throw new AggregateException(exceptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user