Mercurial > hg > graal-compiler
comparison src/os/linux/vm/osThread_linux.hpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 960a442eae91 |
children | f2110083203d |
comparison
equal
deleted
inserted
replaced
5891:fd8832ae511d | 6275:957c266d8bc5 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1999, 2012, 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. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #ifndef OS_LINUX_VM_OSTHREAD_LINUX_HPP | 25 #ifndef OS_LINUX_VM_OSTHREAD_LINUX_HPP |
26 #define OS_LINUX_VM_OSTHREAD_LINUX_HPP | 26 #define OS_LINUX_VM_OSTHREAD_LINUX_HPP |
27 public: | |
28 typedef pid_t thread_id_t; | |
27 | 29 |
28 private: | 30 private: |
29 int _thread_type; | 31 int _thread_type; |
30 | 32 |
31 public: | 33 public: |
35 } | 37 } |
36 void set_thread_type(int type) { | 38 void set_thread_type(int type) { |
37 _thread_type = type; | 39 _thread_type = type; |
38 } | 40 } |
39 | 41 |
40 private: | |
41 | |
42 // _thread_id is kernel thread id (similar to LWP id on Solaris). Each | |
43 // thread has a unique thread_id (LinuxThreads or NPTL). It can be used | |
44 // to access /proc. | |
45 pid_t _thread_id; | |
46 | |
47 // _pthread_id is the pthread id, which is used by library calls | 42 // _pthread_id is the pthread id, which is used by library calls |
48 // (e.g. pthread_kill). | 43 // (e.g. pthread_kill). |
49 pthread_t _pthread_id; | 44 pthread_t _pthread_id; |
50 | 45 |
51 sigset_t _caller_sigmask; // Caller's signal mask | 46 sigset_t _caller_sigmask; // Caller's signal mask |
54 | 49 |
55 // Methods to save/restore caller's signal mask | 50 // Methods to save/restore caller's signal mask |
56 sigset_t caller_sigmask() const { return _caller_sigmask; } | 51 sigset_t caller_sigmask() const { return _caller_sigmask; } |
57 void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } | 52 void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } |
58 | 53 |
59 pid_t thread_id() const { | |
60 return _thread_id; | |
61 } | |
62 #ifndef PRODUCT | 54 #ifndef PRODUCT |
63 // Used for debugging, return a unique integer for each thread. | 55 // Used for debugging, return a unique integer for each thread. |
64 int thread_identifier() const { return _thread_id; } | 56 int thread_identifier() const { return _thread_id; } |
65 #endif | 57 #endif |
66 #ifdef ASSERT | 58 #ifdef ASSERT |
68 // | 60 // |
69 bool valid_reposition_failure() { | 61 bool valid_reposition_failure() { |
70 return false; | 62 return false; |
71 } | 63 } |
72 #endif // ASSERT | 64 #endif // ASSERT |
73 void set_thread_id(pid_t id) { | |
74 _thread_id = id; | |
75 } | |
76 pthread_t pthread_id() const { | 65 pthread_t pthread_id() const { |
77 return _pthread_id; | 66 return _pthread_id; |
78 } | 67 } |
79 void set_pthread_id(pthread_t tid) { | 68 void set_pthread_id(pthread_t tid) { |
80 _pthread_id = tid; | 69 _pthread_id = tid; |