equal
deleted
inserted
replaced
202 void push_front(const Block& block); |
202 void push_front(const Block& block); |
203 void push_back(const Block& block); |
203 void push_back(const Block& block); |
204 void unlink(const Block& block); |
204 void unlink(const Block& block); |
205 }; |
205 }; |
206 |
206 |
207 // RCU-inspired protection of access to _active_array. |
|
208 class ProtectActive { |
|
209 volatile uint _enter; |
|
210 volatile uint _exit[2]; |
|
211 |
|
212 public: |
|
213 ProtectActive(); |
|
214 |
|
215 uint read_enter(); |
|
216 void read_exit(uint enter_value); |
|
217 void write_synchronize(); |
|
218 }; |
|
219 |
|
220 private: |
207 private: |
221 const char* _name; |
208 const char* _name; |
222 ActiveArray* _active_array; |
209 ActiveArray* _active_array; |
223 AllocateList _allocate_list; |
210 AllocateList _allocate_list; |
224 Block* volatile _deferred_updates; |
211 Block* volatile _deferred_updates; |
226 Mutex* _allocate_mutex; |
213 Mutex* _allocate_mutex; |
227 Mutex* _active_mutex; |
214 Mutex* _active_mutex; |
228 |
215 |
229 // Volatile for racy unlocked accesses. |
216 // Volatile for racy unlocked accesses. |
230 volatile size_t _allocation_count; |
217 volatile size_t _allocation_count; |
231 |
|
232 // Protection for _active_array. |
|
233 mutable ProtectActive _protect_active; |
|
234 |
218 |
235 // mutable because this gets set even for const iteration. |
219 // mutable because this gets set even for const iteration. |
236 mutable bool _concurrent_iteration_active; |
220 mutable bool _concurrent_iteration_active; |
237 |
221 |
238 Block* find_block_or_null(const oop* ptr) const; |
222 Block* find_block_or_null(const oop* ptr) const; |