8076225: Move the thread claim parity from SharedHeap to Thread

Reviewed-by: brutisso, jwilhelm, kbarrett
This commit is contained in:
Mikael Gerdin 2015-03-31 07:54:56 +02:00
parent 0efa369ffb
commit 062cf882e0
6 changed files with 39 additions and 26 deletions

View file

@ -113,10 +113,6 @@ protected:
// A gc policy, controls global gc resource issues
CollectorPolicy *_collector_policy;
// See the discussion below, in the specification of the reader function
// for this variable.
int _strong_roots_parity;
// If we're doing parallel GC, use this gang of threads.
FlexibleWorkGang* _workers;
@ -156,7 +152,10 @@ public:
bool no_gc_in_progress() { return !is_gc_active(); }
// Some collectors will perform "process_strong_roots" in parallel.
// Note, the below comment needs to be updated to reflect the changes
// introduced by JDK-8076225. This should be done as part of JDK-8076289.
//
//Some collectors will perform "process_strong_roots" in parallel.
// Such a call will involve claiming some fine-grained tasks, such as
// scanning of threads. To make this process simpler, we provide the
// "strong_roots_parity()" method. Collectors that start parallel tasks
@ -182,7 +181,6 @@ public:
// task-claiming variables may be initialized, to indicate "never
// claimed".
public:
int strong_roots_parity() { return _strong_roots_parity; }
// Call these in sequential code around process_roots.
// strong_roots_prologue calls change_strong_roots_parity, if
@ -192,11 +190,10 @@ public:
public:
StrongRootsScope(SharedHeap* heap, bool activate = true);
~StrongRootsScope();
};
friend class StrongRootsScope;
private:
void change_strong_roots_parity();
public:
FlexibleWorkGang* workers() const { return _workers; }