48
49 Monitor _monitor;
50 Message _message;
51
52 ReferencePendingListLockerThread();
53
54 static void start(JavaThread* thread, TRAPS);
55
56 void send_message(Message message);
57 void receive_and_handle_messages();
58
59 public:
60 static ReferencePendingListLockerThread* create(TRAPS);
61
62 virtual bool is_hidden_from_external_view() const;
63
64 void lock();
65 void unlock();
66 };
67
68 //
69 // The ReferencePendingListLocker is the main interface for locking and
70 // unlocking the reference pending list lock, which needs to be held by
71 // the GC when adding references to the pending list. Since this is a
72 // Java-level monitor it can only be locked/unlocked by a Java thread.
73 // For this reason there is an option to spawn a helper thread, the
74 // ReferencePendingListLockerThread, during initialization. If a helper
75 // thread is spawned all lock operations from non-Java threads will be
76 // delegated to the helper thread. The helper thread is typically needed
77 // by concurrent GCs.
78 //
79 class ReferencePendingListLocker VALUE_OBJ_CLASS_SPEC {
80 private:
81 static bool _is_initialized;
82 static ReferencePendingListLockerThread* _locker_thread;
83 BasicLock _basic_lock;
84
85 public:
86 static void initialize(bool needs_locker_thread, TRAPS);
87 static bool is_initialized();
88
89 static bool is_locked_by_self();
90
91 void lock();
92 void unlock();
93 };
94
95 #endif // SHARE_VM_GC_SHARED_REFERENCEPENDINGLISTLOCKER_HPP
|
48
49 Monitor _monitor;
50 Message _message;
51
52 ReferencePendingListLockerThread();
53
54 static void start(JavaThread* thread, TRAPS);
55
56 void send_message(Message message);
57 void receive_and_handle_messages();
58
59 public:
60 static ReferencePendingListLockerThread* create(TRAPS);
61
62 virtual bool is_hidden_from_external_view() const;
63
64 void lock();
65 void unlock();
66 };
67
68 class ReferencePendingListLockerFromJava VALUE_OBJ_CLASS_SPEC {
69 private:
70 BasicLock _basic_lock;
71
72 public:
73 static bool is_locked_by_self();
74
75 void lock();
76 void unlock();
77 };
78
79 //
80 // The ReferencePendingListLocker is the main interface for locking and
81 // unlocking the reference pending list lock, which needs to be held by
82 // the GC when adding references to the pending list. Since this is a
83 // Java-level monitor it can only be locked/unlocked by a Java thread.
84 // For this reason there is an option to spawn a helper thread, the
85 // ReferencePendingListLockerThread, during initialization. If a helper
86 // thread is spawned all lock operations from non-Java threads will be
87 // delegated to the helper thread. The helper thread is typically needed
88 // by concurrent GCs.
89 //
90 class ReferencePendingListLocker VALUE_OBJ_CLASS_SPEC {
91 private:
92 static bool _is_initialized;
93 static ReferencePendingListLockerThread* _locker_thread;
94 ReferencePendingListLockerFromJava _locker;
95
96 public:
97 static void initialize(bool needs_locker_thread, TRAPS);
98 static bool is_initialized();
99
100 static bool is_locked_by_self();
101
102 void lock();
103 void unlock();
104 };
105
106 #endif // SHARE_VM_GC_SHARED_REFERENCEPENDINGLISTLOCKER_HPP
|