src/os/bsd/vm/osThread_bsd.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
7089790_bsd_vs_linux Cdiff src/os/bsd/vm/osThread_bsd.hpp
src/os/bsd/vm/osThread_bsd.hpp
Print this page
rev 2698 : new bsd files
*** 20,31 ****
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
! #ifndef OS_LINUX_VM_OSTHREAD_LINUX_HPP
! #define OS_LINUX_VM_OSTHREAD_LINUX_HPP
private:
int _thread_type;
public:
--- 20,31 ----
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
! #ifndef OS_BSD_VM_OSTHREAD_BSD_HPP
! #define OS_BSD_VM_OSTHREAD_BSD_HPP
private:
int _thread_type;
public:
*** 37,80 ****
_thread_type = type;
}
private:
// _thread_id is kernel thread id (similar to LWP id on Solaris). Each
! // thread has a unique thread_id (LinuxThreads or NPTL). It can be used
// to access /proc.
pid_t _thread_id;
// _pthread_id is the pthread id, which is used by library calls
// (e.g. pthread_kill).
pthread_t _pthread_id;
sigset_t _caller_sigmask; // Caller's signal mask
public:
// Methods to save/restore caller's signal mask
sigset_t caller_sigmask() const { return _caller_sigmask; }
void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; }
pid_t thread_id() const {
return _thread_id;
}
#ifndef PRODUCT
// Used for debugging, return a unique integer for each thread.
! int thread_identifier() const { return _thread_id; }
#endif
#ifdef ASSERT
// We expect no reposition failures so kill vm if we get one.
//
bool valid_reposition_failure() {
return false;
}
#endif // ASSERT
void set_thread_id(pid_t id) {
_thread_id = id;
}
pthread_t pthread_id() const {
return _pthread_id;
}
void set_pthread_id(pthread_t tid) {
_pthread_id = tid;
--- 37,99 ----
_thread_type = type;
}
private:
+ #ifdef _ALLBSD_SOURCE
+ // _thread_id and _pthread_id are the same on BSD
+ // keep both to minimize code divergence in os_bsd.cpp
+ pthread_t _thread_id;
+ pthread_t _pthread_id;
+ #else
// _thread_id is kernel thread id (similar to LWP id on Solaris). Each
! // thread has a unique thread_id (BsdThreads or NPTL). It can be used
// to access /proc.
pid_t _thread_id;
// _pthread_id is the pthread id, which is used by library calls
// (e.g. pthread_kill).
pthread_t _pthread_id;
+ #endif
sigset_t _caller_sigmask; // Caller's signal mask
public:
// Methods to save/restore caller's signal mask
sigset_t caller_sigmask() const { return _caller_sigmask; }
void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; }
+ #ifdef _ALLBSD_SOURCE
+ pthread_t thread_id() const {
+ return _thread_id;
+ }
+ #else
pid_t thread_id() const {
return _thread_id;
}
+ #endif
#ifndef PRODUCT
// Used for debugging, return a unique integer for each thread.
! intptr_t thread_identifier() const { return (intptr_t)_pthread_id; }
#endif
#ifdef ASSERT
// We expect no reposition failures so kill vm if we get one.
//
bool valid_reposition_failure() {
return false;
}
#endif // ASSERT
+ #ifdef _ALLBSD_SOURCE
+ void set_thread_id(pthread_t id) {
+ _thread_id = id;
+ }
+ #else
void set_thread_id(pid_t id) {
_thread_id = id;
}
+ #endif
pthread_t pthread_id() const {
return _pthread_id;
}
void set_pthread_id(pthread_t tid) {
_pthread_id = tid;
*** 83,96 ****
// ***************************************************************
// suspension support.
// ***************************************************************
public:
! // flags that support signal based suspend/resume on Linux are in a
// separate class to avoid confusion with many flags in OSThread that
// are used by VM level suspend/resume.
! os::Linux::SuspendResume sr;
// _ucontext and _siginfo are used by SR_handler() to save thread context,
// and they will later be used to walk the stack or reposition thread PC.
// If the thread is not suspended in SR_handler() (e.g. self suspend),
// the value in _ucontext is meaningless, so we must use the last Java
--- 102,115 ----
// ***************************************************************
// suspension support.
// ***************************************************************
public:
! // flags that support signal based suspend/resume on Bsd are in a
// separate class to avoid confusion with many flags in OSThread that
// are used by VM level suspend/resume.
! os::Bsd::SuspendResume sr;
// _ucontext and _siginfo are used by SR_handler() to save thread context,
// and they will later be used to walk the stack or reposition thread PC.
// If the thread is not suspended in SR_handler() (e.g. self suspend),
// the value in _ucontext is meaningless, so we must use the last Java
*** 141,146 ****
// Reconciliation History
// osThread_solaris.hpp 1.24 99/08/27 13:11:54
// End
! #endif // OS_LINUX_VM_OSTHREAD_LINUX_HPP
--- 160,165 ----
// Reconciliation History
// osThread_solaris.hpp 1.24 99/08/27 13:11:54
// End
! #endif // OS_BSD_VM_OSTHREAD_BSD_HPP
src/os/bsd/vm/osThread_bsd.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File