1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_SWEEPER_THREAD_H_
6 #define V8_SWEEPER_THREAD_H_
8 #include "src/base/atomicops.h"
10 #include "src/platform.h"
11 #include "src/utils.h"
13 #include "src/spaces.h"
20 class SweeperThread : public Thread {
22 explicit SweeperThread(Isolate* isolate);
28 void WaitForSweeperThread();
29 bool SweepingCompleted();
31 static int NumberOfThreads(int max_available);
36 MarkCompactCollector* collector_;
37 Semaphore start_sweeping_semaphore_;
38 Semaphore end_sweeping_semaphore_;
39 Semaphore stop_semaphore_;
40 volatile base::AtomicWord stop_thread_;
43 } } // namespace v8::internal
45 #endif // V8_SWEEPER_THREAD_H_