src/share/vm/memory/sharedHeap.cpp

changeset 3294
bca17e38de00
parent 3115
c2bf0120ee5d
child 3357
441e946dc1af
     1.1 --- a/src/share/vm/memory/sharedHeap.cpp	Tue Nov 22 04:47:10 2011 -0500
     1.2 +++ b/src/share/vm/memory/sharedHeap.cpp	Tue Aug 09 10:16:01 2011 -0700
     1.3 @@ -58,7 +58,6 @@
     1.4    _perm_gen(NULL), _rem_set(NULL),
     1.5    _strong_roots_parity(0),
     1.6    _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
     1.7 -  _n_par_threads(0),
     1.8    _workers(NULL)
     1.9  {
    1.10    if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
    1.11 @@ -80,6 +79,14 @@
    1.12    }
    1.13  }
    1.14  
    1.15 +int SharedHeap::n_termination() {
    1.16 +  return _process_strong_tasks->n_threads();
    1.17 +}
    1.18 +
    1.19 +void SharedHeap::set_n_termination(int t) {
    1.20 +  _process_strong_tasks->set_n_threads(t);
    1.21 +}
    1.22 +
    1.23  bool SharedHeap::heap_lock_held_for_gc() {
    1.24    Thread* t = Thread::current();
    1.25    return    Heap_lock->owned_by_self()
    1.26 @@ -144,6 +151,10 @@
    1.27    StrongRootsScope srs(this, activate_scope);
    1.28    // General strong roots.
    1.29    assert(_strong_roots_parity != 0, "must have called prologue code");
    1.30 +  // _n_termination for _process_strong_tasks should be set up stream
    1.31 +  // in a method not running in a GC worker.  Otherwise the GC worker
    1.32 +  // could be trying to change the termination condition while the task
    1.33 +  // is executing in another GC worker.
    1.34    if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) {
    1.35      Universe::oops_do(roots);
    1.36      // Consider perm-gen discovered lists to be strong.

mercurial