Skip to content

Commit

Permalink
minor change in stop criterion checker
Browse files Browse the repository at this point in the history
  • Loading branch information
hdbeukel committed Jun 6, 2015
1 parent 99934bd commit 4e94463
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,25 +200,25 @@ public void run() {
// actions should be taken anymore (stopping the search could be dangerous because a next
// search run might have been initiated in the meantime)

if(stopCriterionSatisfied()){
// synchronize on running task updates to ensure that this task
// is not cancelled while executing the following code block
synchronized(runningTaskLock){
if (runningTask == this) {
// synchronize on running task updates to ensure that this task
// is not cancelled while executing the following code block
synchronized(runningTaskLock){
if (runningTask == this) {
if(stopCriterionSatisfied()){
// stop checking
stopChecking();
// log
logger.debug("Requesting search {} to stop", search);
// stop the search
search.stop();
} else {
if(logger.isDebugEnabled()){
// log
logger.debug("Aborting cancelled stop criterion check task @{} for search {} (currently scheduled task: @{})",
Integer.toHexString(this.hashCode()),
search,
Integer.toHexString(runningTask.hashCode()));
}
}
} else {
if(logger.isDebugEnabled()){
// log
logger.debug("Aborting cancelled stop criterion check task @{} for search {} (currently scheduled task: @{})",
Integer.toHexString(this.hashCode()),
search,
Integer.toHexString(runningTask.hashCode()));
}
}
}
Expand Down

0 comments on commit 4e94463

Please sign in to comment.