102 Mutex* fl_lock,
103 int process_completed_threshold,
104 int max_completed_queue,
105 Mutex* lock,
106 DirtyCardQueueSet* fl_owner) {
107 _mut_process_closure = cl;
108 PtrQueueSet::initialize(cbl_mon,
109 fl_lock,
110 process_completed_threshold,
111 max_completed_queue,
112 fl_owner);
113 set_buffer_size(G1UpdateBufferSize);
114 _shared_dirty_card_queue.set_lock(lock);
115 _free_ids = new FreeIdSet((int) num_par_ids(), _cbl_mon);
116 }
117
118 void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) {
119 t->dirty_card_queue().handle_zero_index();
120 }
121
122 void DirtyCardQueueSet::iterate_closure_all_threads(CardTableEntryClosure* cl,
123 bool consume,
124 uint worker_i) {
125 assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
126 for (JavaThread* t = Threads::first(); t; t = t->next()) {
127 bool b = t->dirty_card_queue().apply_closure(cl, consume);
128 guarantee(b, "Should not be interrupted.");
129 }
130 bool b = shared_dirty_card_queue()->apply_closure(cl,
131 consume,
132 worker_i);
133 guarantee(b, "Should not be interrupted.");
134 }
135
136 bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
137
138 // Used to determine if we had already claimed a par_id
139 // before entering this method.
140 bool already_claimed = false;
141
142 // We grab the current JavaThread.
143 JavaThread* thread = JavaThread::current();
144
145 // We get the the number of any par_id that this thread
146 // might have already claimed.
147 uint worker_i = thread->get_claimed_par_id();
148
149 // If worker_i is not UINT_MAX then the thread has already claimed
150 // a par_id. We make note of it using the already_claimed value
151 if (worker_i != UINT_MAX) {
152 already_claimed = true;
153 } else {
154
155 // Otherwise we need to claim a par id
|
102 Mutex* fl_lock,
103 int process_completed_threshold,
104 int max_completed_queue,
105 Mutex* lock,
106 DirtyCardQueueSet* fl_owner) {
107 _mut_process_closure = cl;
108 PtrQueueSet::initialize(cbl_mon,
109 fl_lock,
110 process_completed_threshold,
111 max_completed_queue,
112 fl_owner);
113 set_buffer_size(G1UpdateBufferSize);
114 _shared_dirty_card_queue.set_lock(lock);
115 _free_ids = new FreeIdSet((int) num_par_ids(), _cbl_mon);
116 }
117
118 void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) {
119 t->dirty_card_queue().handle_zero_index();
120 }
121
122 bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
123
124 // Used to determine if we had already claimed a par_id
125 // before entering this method.
126 bool already_claimed = false;
127
128 // We grab the current JavaThread.
129 JavaThread* thread = JavaThread::current();
130
131 // We get the the number of any par_id that this thread
132 // might have already claimed.
133 uint worker_i = thread->get_claimed_par_id();
134
135 // If worker_i is not UINT_MAX then the thread has already claimed
136 // a par_id. We make note of it using the already_claimed value
137 if (worker_i != UINT_MAX) {
138 already_claimed = true;
139 } else {
140
141 // Otherwise we need to claim a par id
|