Index: src/sweeper-thread.cc |
diff --git a/src/sweeper-thread.cc b/src/sweeper-thread.cc |
index 5a50c643d6a3e7be5adc363252bd0f180ff1d016..e8c8cd68d8489644c9330681a514c6800fc350a5 100644 |
--- a/src/sweeper-thread.cc |
+++ b/src/sweeper-thread.cc |
@@ -66,6 +66,15 @@ void SweeperThread::WaitForSweeperThread() { |
} |
+bool SweeperThread::SweepingCompleted() { |
+ bool value = end_sweeping_semaphore_.WaitFor(TimeDelta::FromSeconds(0)); |
+ if (value) { |
+ end_sweeping_semaphore_.Signal(); |
+ } |
+ return value; |
+} |
+ |
+ |
int SweeperThread::NumberOfThreads(int max_available) { |
if (!FLAG_concurrent_sweeping && !FLAG_parallel_sweeping) return 0; |
if (FLAG_sweeper_threads > 0) return FLAG_sweeper_threads; |