Improve thread safety.

Also, correct a spelling error.
This commit is contained in:
Jim Blake 2014-06-14 11:04:18 -04:00
parent 338dd6344a
commit 4edd490fbb

View file

@ -19,7 +19,7 @@ class IndexWorkerThread extends VitroBackgroundThread{
protected final int threadNum;
protected final IndexerIface indexer;
protected final Iterator<Individual> 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.