src/share/vm/utilities/workgroup.cpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_workgroup.cpp.incl"



  27 
  28 // Definitions of WorkGang methods.
  29 
  30 AbstractWorkGang::AbstractWorkGang(const char* name,
  31                                    bool  are_GC_task_threads,
  32                                    bool  are_ConcurrentGC_threads) :
  33   _name(name),
  34   _are_GC_task_threads(are_GC_task_threads),
  35   _are_ConcurrentGC_threads(are_ConcurrentGC_threads) {
  36 
  37   assert(!(are_GC_task_threads && are_ConcurrentGC_threads),
  38          "They cannot both be STW GC and Concurrent threads" );
  39 
  40   // Other initialization.
  41   _monitor = new Monitor(/* priority */       Mutex::leaf,
  42                          /* name */           "WorkGroup monitor",
  43                          /* allow_vm_block */ are_GC_task_threads);
  44   assert(monitor() != NULL, "Failed to allocate monitor");
  45   _terminate = false;
  46   _task = NULL;




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.hpp"
  27 #include "memory/allocation.inline.hpp"
  28 #include "runtime/os.hpp"
  29 #include "utilities/workgroup.hpp"
  30 
  31 // Definitions of WorkGang methods.
  32 
  33 AbstractWorkGang::AbstractWorkGang(const char* name,
  34                                    bool  are_GC_task_threads,
  35                                    bool  are_ConcurrentGC_threads) :
  36   _name(name),
  37   _are_GC_task_threads(are_GC_task_threads),
  38   _are_ConcurrentGC_threads(are_ConcurrentGC_threads) {
  39 
  40   assert(!(are_GC_task_threads && are_ConcurrentGC_threads),
  41          "They cannot both be STW GC and Concurrent threads" );
  42 
  43   // Other initialization.
  44   _monitor = new Monitor(/* priority */       Mutex::leaf,
  45                          /* name */           "WorkGroup monitor",
  46                          /* allow_vm_block */ are_GC_task_threads);
  47   assert(monitor() != NULL, "Failed to allocate monitor");
  48   _terminate = false;
  49   _task = NULL;