Skip to content

Commit

Permalink
Fix dead lock
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryshao committed Apr 13, 2015
1 parent 8b73701 commit d6c94da
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ private[spark] class TieredDiskMerger[K, C](
* Notify the merger that no more on disk blocks will be registered.
*/
def doneRegisteringOnDiskBlocks(): Unit = {
doneRegistering = true
mergeReadyMonitor.synchronized {
doneRegistering = true
mergeReadyMonitor.notify()
}
}
Expand Down Expand Up @@ -175,7 +175,9 @@ private[spark] class TieredDiskMerger[K, C](
while (!doneRegistering || onDiskBlocks.size() > maxMergeFactor) {
while (!shouldMergeNow()) {
mergeReadyMonitor.synchronized {
mergeReadyMonitor.wait()
if (!shouldMergeNow()) {
mergeReadyMonitor.wait()
}
}
}

Expand Down

0 comments on commit d6c94da

Please sign in to comment.