File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/de/rub/nds/crawler/core Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public abstract class BulkScanWorker<T extends ScanConfig> {
2424 private final AtomicInteger activeJobs = new AtomicInteger (0 );
2525 private final AtomicBoolean initialized = new AtomicBoolean (false );
2626 private final AtomicBoolean shouldCleanupSelf = new AtomicBoolean (false );
27+ private final Object initializationLock = new Object ();
2728 protected final String bulkScanId ;
2829 protected final T scanConfig ;
2930
@@ -67,7 +68,7 @@ public final boolean init() {
6768 // synchronize such that no thread runs before being initialized
6869 // but only synchronize if not already initialized
6970 if (!initialized .get ()) {
70- synchronized (initialized ) {
71+ synchronized (initializationLock ) {
7172 if (!initialized .getAndSet (true )) {
7273 initInternal ();
7374 return true ;
@@ -81,7 +82,7 @@ public final boolean cleanup() {
8182 // synchronize such that init and cleanup do not run simultaneously
8283 // but only synchronize if already initialized
8384 if (initialized .get ()) {
84- synchronized (initialized ) {
85+ synchronized (initializationLock ) {
8586 if (activeJobs .get () > 0 ) {
8687 shouldCleanupSelf .set (true );
8788 LOGGER .warn (
You can’t perform that action at this time.
0 commit comments