From 0ef7a1feb75def66db104742745a33e07efca57a Mon Sep 17 00:00:00 2001 From: Stephan Preibisch Date: Fri, 11 Oct 2024 15:34:58 -0400 Subject: [PATCH] fix ForkJoinPool shutdown --- .../net/preibisch/mvrecon/process/export/ExportN5Api.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java b/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java index da37a161..91a98f78 100644 --- a/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java +++ b/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java @@ -304,7 +304,7 @@ else if ( storageType == StorageFormat.N5 || storageType == StorageFormat.ZARR ) } ) ).get(); - myPool.shutdown(); + //myPool.shutdown(); } catch (InterruptedException | ExecutionException e) { @@ -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) { @@ -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; }