Skip to content

Commit

Permalink
fix ForkJoinPool shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Oct 11, 2024
1 parent 3d1f5fe commit 0ef7a1f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ else if ( storageType == StorageFormat.N5 || storageType == StorageFormat.ZARR )
} )
).get();

myPool.shutdown();
//myPool.shutdown();
}
catch (InterruptedException | ExecutionException e)
{
Expand Down Expand Up @@ -346,8 +346,6 @@ else if ( storageType == StorageFormat.N5 || storageType == StorageFormat.ZARR )
IJ.showProgress( progress.incrementAndGet(), allBlocks.size() );
})).get();

myPool.shutdown();
myPool.awaitTermination( Long.MAX_VALUE, TimeUnit.HOURS);
}
catch (InterruptedException | ExecutionException e)
{
Expand All @@ -360,6 +358,9 @@ else if ( storageType == StorageFormat.N5 || storageType == StorageFormat.ZARR )
IOFunctions.println( new Date( System.currentTimeMillis() ) + ": Saved level s " + level + ", took: " + (System.currentTimeMillis() - time ) + " ms." );
}

myPool.shutdown();
try { myPool.awaitTermination( Long.MAX_VALUE, TimeUnit.HOURS); } catch (InterruptedException e) { e.printStackTrace(); }

return true;
}

Expand Down

0 comments on commit 0ef7a1f

Please sign in to comment.