mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8020701: Avoid crashes in WatcherThread
Reviewed-by: acorn, dcubed, dsimms
This commit is contained in:
parent
71ca890b66
commit
2d77390705
14 changed files with 169 additions and 1 deletions
|
@ -733,6 +733,8 @@ class WatcherThread: public Thread {
|
|||
|
||||
static bool _startable;
|
||||
volatile static bool _should_terminate; // updated without holding lock
|
||||
|
||||
os::WatcherThreadCrashProtection* _crash_protection;
|
||||
public:
|
||||
enum SomeConstants {
|
||||
delay_interval = 10 // interrupt delay in milliseconds
|
||||
|
@ -760,6 +762,14 @@ class WatcherThread: public Thread {
|
|||
// Otherwise the first task to enroll will trigger the start
|
||||
static void make_startable();
|
||||
|
||||
void set_crash_protection(os::WatcherThreadCrashProtection* crash_protection) {
|
||||
assert(Thread::current()->is_Watcher_thread(), "Can only be set by WatcherThread");
|
||||
_crash_protection = crash_protection;
|
||||
}
|
||||
|
||||
bool has_crash_protection() const { return _crash_protection != NULL; }
|
||||
os::WatcherThreadCrashProtection* crash_protection() const { return _crash_protection; }
|
||||
|
||||
private:
|
||||
int sleep() const;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue