File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
objectbox-java/src/main/java/io/objectbox Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -276,16 +276,19 @@ static boolean isFileOpen(final String canonicalPath) {
276
276
synchronized (openFiles ) {
277
277
if (!openFiles .contains (canonicalPath )) return false ;
278
278
}
279
- if (openFilesCheckerThread == null || !openFilesCheckerThread .isAlive ()) {
279
+ Thread checkerThread = BoxStore .openFilesCheckerThread ;
280
+ if (checkerThread == null || !checkerThread .isAlive ()) {
280
281
// Use a thread to avoid finalizers that block us
281
- openFilesCheckerThread = new Thread (() -> {
282
+ checkerThread = new Thread (() -> {
282
283
isFileOpenSync (canonicalPath , true );
283
- openFilesCheckerThread = null ; // Clean ref to itself
284
+ BoxStore . openFilesCheckerThread = null ; // Clean ref to itself
284
285
});
285
- openFilesCheckerThread .setDaemon (true );
286
- openFilesCheckerThread .start ();
286
+ checkerThread .setDaemon (true );
287
+
288
+ BoxStore .openFilesCheckerThread = checkerThread ;
289
+ checkerThread .start ();
287
290
try {
288
- openFilesCheckerThread .join (500 );
291
+ checkerThread .join (500 );
289
292
} catch (InterruptedException e ) {
290
293
e .printStackTrace ();
291
294
}
You can’t perform that action at this time.
0 commit comments