The closed variable in OrtEnvironment should be volatile to ensure threads see changes to it.

This commit is contained in:
Adam Pocock 2020-01-29 16:33:42 -05:00 committed by Changming Sun
parent 4cc0031177
commit c23bd93ea5

View file

@ -125,7 +125,7 @@ public class OrtEnvironment implements AutoCloseable {
final OrtAllocator defaultAllocator;
private boolean closed = false;
private volatile boolean closed = false;
/**
* Create an OrtEnvironment using a default name.