17INLINE
Thread *ThreadSimpleImpl::
27INLINE
bool ThreadSimpleImpl::
28is_same_system_thread()
const {
29#ifdef HAVE_POSIX_THREADS
30 return pthread_equal(_posix_system_thread_id, pthread_self());
33 return (_win32_system_thread_id == GetCurrentThreadId());
42INLINE
void ThreadSimpleImpl::
49INLINE
bool ThreadSimpleImpl::
50is_threading_supported() {
57INLINE
bool ThreadSimpleImpl::
65INLINE
void ThreadSimpleImpl::
66sleep(
double seconds) {
67 ThreadSimpleManager *manager = ThreadSimpleManager::get_global_ptr();
68 if (manager->is_same_system_thread()) {
69 ThreadSimpleImpl *thread = manager->get_current_thread();
70 thread->sleep_this(seconds);
72 manager->system_sleep(seconds);
79INLINE
void ThreadSimpleImpl::
81 ThreadSimpleManager *manager = ThreadSimpleManager::get_global_ptr();
82 if (manager->is_same_system_thread()) {
83 ThreadSimpleImpl *thread = manager->get_current_thread();
84 thread->yield_this(
true);
86 manager->system_yield();
93INLINE
void ThreadSimpleImpl::
95 ThreadSimpleManager *manager = ThreadSimpleManager::get_global_ptr();
96 if (manager->is_same_system_thread()) {
97 ThreadSimpleImpl *thread = manager->get_current_thread();
98 thread->consider_yield_this();
105INLINE
void ThreadSimpleImpl::
106consider_yield_this() {
107 double now = _manager->get_current_time();
108 if (now >= _stop_time) {
116INLINE
double ThreadSimpleImpl::
117get_wake_time()
const {
124void ThreadSimpleImpl::
125write_status(std::ostream &out) {
126 ThreadSimpleManager *manager = ThreadSimpleManager::get_global_ptr();
127 manager->write_status(out);
A thread; that is, a lightweight process.
get_current_thread
Returns a pointer to the currently-executing Thread object.