fix(engine): add volatile to AnglePredictor lock field and Models content copy
- Mark _loadAttempted as volatile for correct double-checked locking - Add Content item to copy Models/ directory to output for ONNX inference Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ namespace OpenNest.Engine.ML
|
||||
public static class AnglePredictor
|
||||
{
|
||||
private static InferenceSession _session;
|
||||
private static bool _loadAttempted;
|
||||
private static volatile bool _loadAttempted;
|
||||
private static readonly object _lock = new();
|
||||
|
||||
public static List<double> PredictAngles(
|
||||
|
||||
@@ -10,4 +10,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.17.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Models\**" CopyToOutputDirectory="PreserveNewest" Condition="Exists('Models')" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user