equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2018, 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. |
37 ServiceThread* ServiceThread::_instance = NULL; |
37 ServiceThread* ServiceThread::_instance = NULL; |
38 |
38 |
39 void ServiceThread::initialize() { |
39 void ServiceThread::initialize() { |
40 EXCEPTION_MARK; |
40 EXCEPTION_MARK; |
41 |
41 |
42 InstanceKlass* klass = SystemDictionary::Thread_klass(); |
|
43 instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); |
|
44 |
|
45 const char* name = "Service Thread"; |
42 const char* name = "Service Thread"; |
46 |
|
47 Handle string = java_lang_String::create_from_str(name, CHECK); |
43 Handle string = java_lang_String::create_from_str(name, CHECK); |
48 |
44 |
49 // Initialize thread_oop to put it into the system threadGroup |
45 // Initialize thread_oop to put it into the system threadGroup |
50 Handle thread_group (THREAD, Universe::system_thread_group()); |
46 Handle thread_group (THREAD, Universe::system_thread_group()); |
51 JavaValue result(T_VOID); |
47 Handle thread_oop = JavaCalls::construct_new_instance( |
52 JavaCalls::call_special(&result, thread_oop, |
48 SystemDictionary::Thread_klass(), |
53 klass, |
|
54 vmSymbols::object_initializer_name(), |
|
55 vmSymbols::threadgroup_string_void_signature(), |
49 vmSymbols::threadgroup_string_void_signature(), |
56 thread_group, |
50 thread_group, |
57 string, |
51 string, |
58 CHECK); |
52 CHECK); |
59 |
53 |