17 INLINE ThreadPosixImpl::
18 ThreadPosixImpl(
Thread *parent_obj) :
19 _parent_obj(parent_obj)
32 INLINE
void ThreadPosixImpl::
39 INLINE
void ThreadPosixImpl::
46 INLINE
Thread *ThreadPosixImpl::
47 get_current_thread() {
48 TAU_PROFILE(
"Thread *ThreadPosixImpl::get_current_thread()",
" ", TAU_USER);
49 if (!_got_pt_ptr_index) {
52 return (
Thread *)pthread_getspecific(_pt_ptr_index);
59 INLINE
void ThreadPosixImpl::
60 bind_thread(
Thread *thread) {
61 if (!_got_pt_ptr_index) {
64 int result = pthread_setspecific(_pt_ptr_index, thread);
65 nassertv(result == 0);
74 INLINE
bool ThreadPosixImpl::
75 is_threading_supported() {
82 INLINE
bool ThreadPosixImpl::
90 INLINE
bool ThreadPosixImpl::
98 INLINE
void ThreadPosixImpl::
99 sleep(
double seconds) {
100 TAU_PROFILE(
"void ThreadPosixImpl::sleep(double)",
" ", TAU_USER);
101 struct timespec rqtp;
102 rqtp.tv_sec = time_t(seconds);
103 rqtp.tv_nsec = long((seconds - (
double)rqtp.tv_sec) * 1000000000.0);
104 nanosleep(&rqtp,
nullptr);
110 INLINE
void ThreadPosixImpl::
118 INLINE
void ThreadPosixImpl::
126 INLINE JNIEnv *ThreadPosixImpl::
127 get_jni_env()
const {
A thread; that is, a lightweight process.