1.1 --- a/src/share/vm/memory/sharedHeap.cpp Thu Sep 16 13:45:55 2010 -0700 1.2 +++ b/src/share/vm/memory/sharedHeap.cpp Mon Sep 20 14:38:38 2010 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -50,7 +50,8 @@ 1.11 _perm_gen(NULL), _rem_set(NULL), 1.12 _strong_roots_parity(0), 1.13 _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)), 1.14 - _workers(NULL), _n_par_threads(0) 1.15 + _n_par_threads(0), 1.16 + _workers(NULL) 1.17 { 1.18 if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) { 1.19 vm_exit_during_initialization("Failed necessary allocation."); 1.20 @@ -60,11 +61,13 @@ 1.21 (UseConcMarkSweepGC && CMSParallelRemarkEnabled) || 1.22 UseG1GC) && 1.23 ParallelGCThreads > 0) { 1.24 - _workers = new WorkGang("Parallel GC Threads", ParallelGCThreads, 1.25 + _workers = new FlexibleWorkGang("Parallel GC Threads", ParallelGCThreads, 1.26 /* are_GC_task_threads */true, 1.27 /* are_ConcurrentGC_threads */false); 1.28 if (_workers == NULL) { 1.29 vm_exit_during_initialization("Failed necessary allocation."); 1.30 + } else { 1.31 + _workers->initialize_workers(); 1.32 } 1.33 } 1.34 } 1.35 @@ -77,8 +80,9 @@ 1.36 } 1.37 1.38 void SharedHeap::set_par_threads(int t) { 1.39 + assert(t == 0 || !UseSerialGC, "Cannot have parallel threads"); 1.40 _n_par_threads = t; 1.41 - _process_strong_tasks->set_par_threads(t); 1.42 + _process_strong_tasks->set_n_threads(t); 1.43 } 1.44 1.45 class AssertIsPermClosure: public OopClosure {