author | brutisso |
Fri, 28 Nov 2014 08:20:52 +0100 | |
changeset 27899 | 17754211a7ab |
parent 27678 | d1872bc7dd8d |
permissions | -rw-r--r-- |
1374 | 1 |
/* |
22234
da823d78ad65
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
15482
diff
changeset
|
2 |
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
1374 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3261
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3261
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3261
diff
changeset
|
21 |
* questions. |
1374 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP |
26 |
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP |
|
27 |
||
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
9990
diff
changeset
|
28 |
#include "utilities/macros.hpp" |
24094 | 29 |
#include "gc_implementation/shared/suspendibleThreadSet.hpp" |
7397 | 30 |
#include "runtime/thread.hpp" |
1374 | 31 |
|
32 |
class ConcurrentGCThread: public NamedThread { |
|
33 |
friend class VMStructs; |
|
34 |
||
35 |
protected: |
|
2881 | 36 |
bool _should_terminate; |
37 |
bool _has_terminated; |
|
1374 | 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; } |
|
51 |
||
52 |
// Create and start the thread (setting it's priority high.) |
|
53 |
void create_and_start(); |
|
54 |
||
55 |
// Do initialization steps in the thread: record stack base and size, |
|
56 |
// init thread local storage, set JNI handle block. |
|
57 |
void initialize_in_thread(); |
|
58 |
||
59 |
// Wait until Universe::is_fully_initialized(); |
|
60 |
void wait_for_universe_init(); |
|
61 |
||
62 |
// Record that the current thread is terminating, and will do more |
|
63 |
// concurrent work. |
|
64 |
void terminate(); |
|
65 |
||
66 |
public: |
|
67 |
// Constructor |
|
68 |
||
69 |
ConcurrentGCThread(); |
|
70 |
~ConcurrentGCThread() {} // Exists to call NamedThread destructor. |
|
71 |
||
72 |
// Tester |
|
73 |
bool is_ConcurrentGC_thread() const { return true; } |
|
74 |
}; |
|
75 |
||
76 |
// The SurrogateLockerThread is used by concurrent GC threads for |
|
77 |
// manipulating Java monitors, in particular, currently for |
|
78 |
// manipulating the pending_list_lock. XXX |
|
79 |
class SurrogateLockerThread: public JavaThread { |
|
80 |
friend class VMStructs; |
|
81 |
public: |
|
82 |
enum SLT_msg_type { |
|
83 |
empty = 0, // no message |
|
84 |
acquirePLL, // acquire pending list lock |
|
85 |
releaseAndNotifyPLL // notify and release pending list lock |
|
86 |
}; |
|
87 |
private: |
|
88 |
// the following are shared with the CMSThread |
|
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 |
||
27678
d1872bc7dd8d
8062036: ConcurrentMarkThread::slt may be invoked before ConcurrentMarkThread::makeSurrogateLockerThread causing intermittent crashes
kbarrett
parents:
24094
diff
changeset
|
96 |
// Terminate VM with error message that SLT needed but not yet created. |
d1872bc7dd8d
8062036: ConcurrentMarkThread::slt may be invoked before ConcurrentMarkThread::makeSurrogateLockerThread causing intermittent crashes
kbarrett
parents:
24094
diff
changeset
|
97 |
static void report_missing_slt(); |
d1872bc7dd8d
8062036: ConcurrentMarkThread::slt may be invoked before ConcurrentMarkThread::makeSurrogateLockerThread causing intermittent crashes
kbarrett
parents:
24094
diff
changeset
|
98 |
|
1374 | 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 |
}; |
|
7397 | 108 |
|
109 |
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP |