1 /*
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP
27
28 #include "utilities/macros.hpp"
29 #include "gc_implementation/shared/suspendibleThreadSet.hpp"
30 #include "runtime/thread.hpp"
31
32 class ConcurrentGCThread: public NamedThread {
33 friend class VMStructs;
34
35 protected:
36 bool _should_terminate;
37 bool _has_terminated;
38
39 enum CGC_flag_type {
40 CGC_nil = 0x0,
41 CGC_dont_suspend = 0x1,
42 CGC_CGC_safepoint = 0x2,
43 CGC_VM_safepoint = 0x4
44 };
45
46 static int _CGC_flag;
47
48 static bool CGC_flag_is_set(int b) { return (_CGC_flag & b) != 0; }
49 static int set_CGC_flag(int b) { return _CGC_flag |= b; }
50 static int reset_CGC_flag(int b) { return _CGC_flag &= ~b; }
89 SLT_msg_type _buffer; // communication buffer
90 Monitor _monitor; // monitor controlling buffer
91 BasicLock _basicLock; // used for PLL locking
92
93 public:
94 static SurrogateLockerThread* make(TRAPS);
95
96 // Terminate VM with error message that SLT needed but not yet created.
97 static void report_missing_slt();
98
99 SurrogateLockerThread();
100
101 bool is_hidden_from_external_view() const { return true; }
102
103 void loop(); // main method
104
105 void manipulatePLL(SLT_msg_type msg);
106
107 };
108
109 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP
|
1 /*
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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 #ifndef SHARE_VM_GC_SHARED_CONCURRENTGCTHREAD_HPP
26 #define SHARE_VM_GC_SHARED_CONCURRENTGCTHREAD_HPP
27
28 #include "gc/g1/suspendibleThreadSet.hpp"
29 #include "runtime/thread.hpp"
30 #include "utilities/macros.hpp"
31
32 class ConcurrentGCThread: public NamedThread {
33 friend class VMStructs;
34
35 protected:
36 bool _should_terminate;
37 bool _has_terminated;
38
39 enum CGC_flag_type {
40 CGC_nil = 0x0,
41 CGC_dont_suspend = 0x1,
42 CGC_CGC_safepoint = 0x2,
43 CGC_VM_safepoint = 0x4
44 };
45
46 static int _CGC_flag;
47
48 static bool CGC_flag_is_set(int b) { return (_CGC_flag & b) != 0; }
49 static int set_CGC_flag(int b) { return _CGC_flag |= b; }
50 static int reset_CGC_flag(int b) { return _CGC_flag &= ~b; }
89 SLT_msg_type _buffer; // communication buffer
90 Monitor _monitor; // monitor controlling buffer
91 BasicLock _basicLock; // used for PLL locking
92
93 public:
94 static SurrogateLockerThread* make(TRAPS);
95
96 // Terminate VM with error message that SLT needed but not yet created.
97 static void report_missing_slt();
98
99 SurrogateLockerThread();
100
101 bool is_hidden_from_external_view() const { return true; }
102
103 void loop(); // main method
104
105 void manipulatePLL(SLT_msg_type msg);
106
107 };
108
109 #endif // SHARE_VM_GC_SHARED_CONCURRENTGCTHREAD_HPP
|