1 /* |
1 /* |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
144 * To be able to use this - don't take locks, don't rely on destructors, |
144 * To be able to use this - don't take locks, don't rely on destructors, |
145 * don't make OS library calls, don't allocate memory, don't print, |
145 * don't make OS library calls, don't allocate memory, don't print, |
146 * don't call code that could leave the heap / memory in an inconsistent state, |
146 * don't call code that could leave the heap / memory in an inconsistent state, |
147 * or anything else where we are not in control if we suddenly jump out. |
147 * or anything else where we are not in control if we suddenly jump out. |
148 */ |
148 */ |
149 class WatcherThreadCrashProtection : public StackObj { |
149 class ThreadCrashProtection : public StackObj { |
150 public: |
150 public: |
151 WatcherThreadCrashProtection(); |
151 static bool is_crash_protected(Thread* thr) { |
|
152 return _crash_protection != NULL && _protected_thread == thr; |
|
153 } |
|
154 |
|
155 ThreadCrashProtection(); |
152 bool call(os::CrashProtectionCallback& cb); |
156 bool call(os::CrashProtectionCallback& cb); |
|
157 private: |
|
158 static Thread* _protected_thread; |
|
159 static ThreadCrashProtection* _crash_protection; |
|
160 static volatile intptr_t _crash_mux; |
153 }; |
161 }; |
154 |
162 |
155 class PlatformEvent : public CHeapObj<mtInternal> { |
163 class PlatformEvent : public CHeapObj<mtInternal> { |
156 private: |
164 private: |
157 double CachePad [4] ; // increase odds that _Event is sole occupant of cache line |
165 double CachePad [4] ; // increase odds that _Event is sole occupant of cache line |