Mercurial > hg > truffle
annotate src/os/solaris/vm/osThread_solaris.hpp @ 16299:732a9e80e8dc
ensure memory map (if any) for a snippet template is attached to the returnNode
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 30 Jun 2014 17:27:40 +0200 |
parents | f2110083203d |
children |
rev | line source |
---|---|
0 | 1 /* |
10405 | 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP |
26 #define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP | |
27 | |
0 | 28 // This is embedded via include into the class OSThread |
6093
960a442eae91
7161732: Improve handling of thread_id in OSThread
rbackman
parents:
6006
diff
changeset
|
29 public: |
960a442eae91
7161732: Improve handling of thread_id in OSThread
rbackman
parents:
6006
diff
changeset
|
30 typedef thread_t thread_id_t; |
0 | 31 |
32 private: | |
4854
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
33 uint _lwp_id; // lwp ID, only used with bound threads |
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
34 int _native_priority; // Saved native priority when starting |
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
35 // a bound thread |
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
36 sigset_t _caller_sigmask; // Caller's signal mask |
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
37 bool _vm_created_thread; // true if the VM created this thread, |
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
38 // false if primary thread or attached thread |
0 | 39 public: |
4854
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
40 uint lwp_id() const { return _lwp_id; } |
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
41 int native_priority() const { return _native_priority; } |
0 | 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 | |
48 sigset_t caller_sigmask() const { return _caller_sigmask; } | |
49 void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } | |
50 | |
51 #ifndef PRODUCT | |
52 // Used for debugging, return a unique integer for each thread. | |
53 int thread_identifier() const { return _thread_id; } | |
54 #endif | |
55 #ifdef ASSERT | |
56 // On solaris reposition can fail in two ways: | |
57 // 1: a mismatched pc, because signal is delivered too late, target thread | |
58 // is resumed. | |
59 // 2: on a timeout where signal is lost, target thread is resumed. | |
60 bool valid_reposition_failure() { | |
61 // only 1 and 2 can happen and we can handle both of them | |
62 return true; | |
63 } | |
64 #endif | |
4854
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
65 void set_lwp_id(uint id) { _lwp_id = id; } |
de268c8a8075
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
phh
parents:
1972
diff
changeset
|
66 void set_native_priority(int prio) { _native_priority = prio; } |
0 | 67 |
68 // *************************************************************** | |
69 // interrupt support. interrupts (using signals) are used to get | |
70 // the thread context (get_thread_pc), to set the thread context | |
71 // (set_thread_pc), and to implement java.lang.Thread.interrupt. | |
72 // *************************************************************** | |
73 | |
74 public: | |
10405 | 75 os::SuspendResume sr; |
0 | 76 |
77 private: | |
10405 | 78 ucontext_t* _ucontext; |
0 | 79 |
80 public: | |
10405 | 81 ucontext_t* ucontext() const { return _ucontext; } |
82 void set_ucontext(ucontext_t* ptr) { _ucontext = ptr; } | |
83 static void SR_handler(Thread* thread, ucontext_t* uc); | |
0 | 84 |
85 // *************************************************************** | |
86 // java.lang.Thread.interrupt state. | |
87 // *************************************************************** | |
88 | |
89 private: | |
90 | |
91 JavaThreadState _saved_interrupt_thread_state; // the thread state before a system call -- restored afterward | |
92 | |
93 public: | |
94 | |
95 | |
96 JavaThreadState saved_interrupt_thread_state() { return _saved_interrupt_thread_state; } | |
97 void set_saved_interrupt_thread_state(JavaThreadState state) { _saved_interrupt_thread_state = state; } | |
98 | |
99 static void handle_spinlock_contention(int tries); // Used for thread local eden locking | |
100 | |
101 // *************************************************************** | |
102 // Platform dependent initialization and cleanup | |
103 // *************************************************************** | |
104 | |
105 private: | |
106 | |
107 void pd_initialize(); | |
108 void pd_destroy(); | |
1972 | 109 |
110 #endif // OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP |