1 /*
2 * Copyright (c) 1997, 2006, 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 // This is embedded via include into the class OSThread
26
27 private:
28
29 thread_t _thread_id; // Solaris thread id
30 unsigned int _lwp_id; // lwp ID, only used with bound threads
31 sigset_t _caller_sigmask; // Caller's signal mask
32 bool _vm_created_thread; // true if the VM create this thread
33 // false if primary thread or attached thread
34 public:
35
36 thread_t thread_id() const { return _thread_id; }
37
38 unsigned int lwp_id() const { return _lwp_id; }
39
40 // Set and get state of _vm_created_thread flag
41 void set_vm_created() { _vm_created_thread = true; }
42 bool is_vm_created() { return _vm_created_thread; }
43
44 // Methods to save/restore caller's signal mask
132 private:
133
134 JavaThreadState _saved_interrupt_thread_state; // the thread state before a system call -- restored afterward
135
136 public:
137
138
139 JavaThreadState saved_interrupt_thread_state() { return _saved_interrupt_thread_state; }
140 void set_saved_interrupt_thread_state(JavaThreadState state) { _saved_interrupt_thread_state = state; }
141
142 static void handle_spinlock_contention(int tries); // Used for thread local eden locking
143
144 // ***************************************************************
145 // Platform dependent initialization and cleanup
146 // ***************************************************************
147
148 private:
149
150 void pd_initialize();
151 void pd_destroy();
|
1 /*
2 * Copyright (c) 1997, 2010, 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 OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
26 #define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
27
28 // This is embedded via include into the class OSThread
29
30 private:
31
32 thread_t _thread_id; // Solaris thread id
33 unsigned int _lwp_id; // lwp ID, only used with bound threads
34 sigset_t _caller_sigmask; // Caller's signal mask
35 bool _vm_created_thread; // true if the VM create this thread
36 // false if primary thread or attached thread
37 public:
38
39 thread_t thread_id() const { return _thread_id; }
40
41 unsigned int lwp_id() const { return _lwp_id; }
42
43 // Set and get state of _vm_created_thread flag
44 void set_vm_created() { _vm_created_thread = true; }
45 bool is_vm_created() { return _vm_created_thread; }
46
47 // Methods to save/restore caller's signal mask
135 private:
136
137 JavaThreadState _saved_interrupt_thread_state; // the thread state before a system call -- restored afterward
138
139 public:
140
141
142 JavaThreadState saved_interrupt_thread_state() { return _saved_interrupt_thread_state; }
143 void set_saved_interrupt_thread_state(JavaThreadState state) { _saved_interrupt_thread_state = state; }
144
145 static void handle_spinlock_contention(int tries); // Used for thread local eden locking
146
147 // ***************************************************************
148 // Platform dependent initialization and cleanup
149 // ***************************************************************
150
151 private:
152
153 void pd_initialize();
154 void pd_destroy();
155
156 #endif // OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
|