From 4edd490fbb85a652309de06203bd7da37c732326 Mon Sep 17 00:00:00 2001 From: Jim Blake Date: Sat, 14 Jun 2014 11:04:18 -0400 Subject: [PATCH] Improve thread safety. Also, correct a spelling error. --- .../vitro/webapp/search/indexing/IndexWorkerThread.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexWorkerThread.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexWorkerThread.java index 8ca506c98..59b5aef39 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexWorkerThread.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexWorkerThread.java @@ -19,7 +19,7 @@ class IndexWorkerThread extends VitroBackgroundThread{ protected final int threadNum; protected final IndexerIface indexer; protected final Iterator individualsToIndex; - protected boolean stopRequested = false; + protected volatile boolean stopRequested = false; private static AtomicLong countCompleted= new AtomicLong(); private static AtomicLong countToIndex= new AtomicLong(); @@ -43,7 +43,7 @@ class IndexWorkerThread extends VitroBackgroundThread{ while( ! stopRequested ){ //do the actual indexing work - log.debug("work found for Woker number " + threadNum); + log.debug("work found for Worker number " + threadNum); addDocsToIndex(); // done so shut this thread down.