21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_CONCURRENTGCPHASEMANAGER_HPP
26 #define SHARE_VM_GC_CONCURRENTGCPHASEMANAGER_HPP
27
28 #include "memory/allocation.hpp"
29
30 // Manage concurrent phase information, to support WhiteBox testing.
31 // Managers are stack allocated. Managers may be nested, to support
32 // nested subphases.
33 class ConcurrentGCPhaseManager : public StackObj {
34 public:
35
36 // Special phase ids used by all GC's that use this facility.
37 static const int UNCONSTRAINED_PHASE = 0; // Unconstrained or no request.
38 static const int IDLE_PHASE = 1; // Concurrent processing is idle.
39
40 // Stack of phase managers.
41 class Stack VALUE_OBJ_CLASS_SPEC {
42 friend class ConcurrentGCPhaseManager;
43
44 public:
45 // Create an empty stack of phase managers.
46 Stack();
47
48 private:
49 int _requested_phase;
50 ConcurrentGCPhaseManager* _top;
51
52 // Non-copyable - never defined.
53 Stack(const Stack&);
54 Stack& operator=(const Stack&);
55 };
56
57 // Construct and push a new manager on the stack, activating phase.
58 // Notifies callers in wait_for_phase of the phase change.
59 //
60 // Preconditions:
61 // - Calling thread must be a ConcurrentGC thread
|
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_CONCURRENTGCPHASEMANAGER_HPP
26 #define SHARE_VM_GC_CONCURRENTGCPHASEMANAGER_HPP
27
28 #include "memory/allocation.hpp"
29
30 // Manage concurrent phase information, to support WhiteBox testing.
31 // Managers are stack allocated. Managers may be nested, to support
32 // nested subphases.
33 class ConcurrentGCPhaseManager : public StackObj {
34 public:
35
36 // Special phase ids used by all GC's that use this facility.
37 static const int UNCONSTRAINED_PHASE = 0; // Unconstrained or no request.
38 static const int IDLE_PHASE = 1; // Concurrent processing is idle.
39
40 // Stack of phase managers.
41 class Stack {
42 friend class ConcurrentGCPhaseManager;
43
44 public:
45 // Create an empty stack of phase managers.
46 Stack();
47
48 private:
49 int _requested_phase;
50 ConcurrentGCPhaseManager* _top;
51
52 // Non-copyable - never defined.
53 Stack(const Stack&);
54 Stack& operator=(const Stack&);
55 };
56
57 // Construct and push a new manager on the stack, activating phase.
58 // Notifies callers in wait_for_phase of the phase change.
59 //
60 // Preconditions:
61 // - Calling thread must be a ConcurrentGC thread
|