![]() |
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Classes | |
| class | PthreadTask |
| struct | KeyEntry |
Typedefs | |
| using | ThreadCtrl = pthread_stk_ctrl_t |
Variables | |
| constexpr std::size_t | kDefaultStackBytes |
| constexpr int | kOnceRunning = 1 |
| constexpr int | kOnceDone = 2 |
| static ThreadCtrl | s_Threads [STK_C_PTHREAD_MAX_THREADS] |
| static stk_kernel_t * | s_BoundKernel = nullptr |
| static stk_blockpool_t * | s_StackPool = nullptr |
| static ThreadCtrl * | s_ReapQueue [STK_C_PTHREAD_MAX_THREADS] |
| static std::size_t | s_ReapHead = 0U |
| static std::size_t | s_ReapCount = 0U |
| static sync::Semaphore * | s_ReapSem = nullptr |
| struct { | |
| uint8_t stk::pthread::data [sizeof(sync::Semaphore)] | |
| } | s_ReapSemBuf |
| static stk_task_t * | s_ReaperTask = nullptr |
| static stk_word_t | s_ReaperStack [STK_C_PTHREAD_REAPER_STACK_WORDS] |
| static KeyEntry | s_Keys [STK_C_PTHREAD_KEYS_MAX] |
Definition at line 173 of file stk_c_pthread.cpp.
|
static |
Definition at line 406 of file stk_c_pthread.cpp.
References s_Threads, and STK_C_PTHREAD_MAX_THREADS.
Referenced by CurrentCtrlOrAdopt(), and pthread_create().
|
static |
Definition at line 483 of file stk_c_pthread.cpp.
References pthread_attr_t::__ext_stack, EnsureStackPool(), kDefaultStackBytes, malloc(), pthread_stk_ctrl_t::stack, pthread_stk_ctrl_t::stack_from_pool, pthread_stk_ctrl_t::stack_owned, and stk_blockpool_try_alloc().
Referenced by pthread_create().
|
static |
Definition at line 645 of file stk_c_pthread.cpp.
Referenced by CurrentCtrlOrAdopt(), pthread_exit(), pthread_getspecific(), and pthread_join().
|
static |
Definition at line 657 of file stk_c_pthread.cpp.
References AcquireThreadSlot(), pthread_stk_ctrl_t::adopted, CurrentCtrl(), and pthread_stk_ctrl_t::detached.
Referenced by pthread_self(), and pthread_setspecific().
|
static |
Definition at line 345 of file stk_c_pthread.cpp.
References s_ReapCount, s_ReapHead, s_ReapQueue, and STK_C_PTHREAD_MAX_THREADS.
Referenced by ReaperEntry().
|
static |
Definition at line 330 of file stk_c_pthread.cpp.
References s_ReapCount, s_ReaperTask, s_ReapHead, s_ReapQueue, STK_C_ASSERT, and STK_C_PTHREAD_MAX_THREADS.
Referenced by MaybeReap().
|
static |
Definition at line 624 of file stk_c_pthread.cpp.
References pthread_cond_t::__handle, pthread_cond_t::__mem, and EnsureObject().
Referenced by pthread_cond_broadcast(), pthread_cond_signal(), pthread_cond_timedwait(), and pthread_cond_wait().
|
static |
Definition at line 583 of file stk_c_pthread.cpp.
References pthread_mutex_t::__handle, pthread_mutex_t::__mem, and EnsureObject().
Referenced by pthread_mutex_lock(), pthread_mutex_timedlock(), and pthread_mutex_trylock().
|
static |
Definition at line 226 of file stk_c_pthread.cpp.
References stk::ConstructIn(), LoadAcquire(), and StoreRelease().
Referenced by EnsureCond(), EnsureMutex(), EnsureOnceMutex(), and EnsureRWLock().
|
static |
Definition at line 634 of file stk_c_pthread.cpp.
References pthread_once_t::__handle, pthread_once_t::__mem, and EnsureObject().
Referenced by pthread_once().
|
static |
Definition at line 309 of file stk_c_pthread.cpp.
References stk::ConstructIn(), ReaperEntry(), s_BoundKernel, s_ReaperStack, s_ReaperTask, s_ReapSem, s_ReapSemBuf, STK_C_ASSERT, STK_C_PTHREAD_REAPER_STACK_WORDS, stk_kernel_add_task(), stk_task_create_user(), and stk_task_set_name().
Referenced by stk_pthread_bind_kernel().
|
static |
Definition at line 629 of file stk_c_pthread.cpp.
References pthread_rwlock_t::__handle, pthread_rwlock_t::__mem, and EnsureObject().
Referenced by pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), and pthread_rwlock_wrlock().
|
static |
Definition at line 268 of file stk_c_pthread.cpp.
References kDefaultStackBytes, LoadAcquire(), s_StackPool, stk_blockpool_create_static(), STK_C_PTHREAD_MAX_THREADS, and StoreRelease().
Referenced by AllocateStack().
|
inlinestatic |
Definition at line 250 of file stk_c_pthread.cpp.
References pthread_barrier_t::__handle.
|
inlinestatic |
Definition at line 247 of file stk_c_pthread.cpp.
References pthread_cond_t::__handle.
|
inlinestatic |
Definition at line 245 of file stk_c_pthread.cpp.
References pthread_mutex_t::__handle.
Referenced by pthread_barrier_destroy(), pthread_barrier_wait(), pthread_cond_destroy(), pthread_cond_timedwait(), pthread_cond_wait(), pthread_mutex_destroy(), pthread_mutex_unlock(), pthread_rwlock_destroy(), pthread_rwlock_unlock(), pthread_spin_destroy(), pthread_spin_lock(), pthread_spin_trylock(), and pthread_spin_unlock().
|
inlinestatic |
|
inlinestatic |
Definition at line 248 of file stk_c_pthread.cpp.
References pthread_rwlock_t::__handle.
|
inlinestatic |
Definition at line 249 of file stk_c_pthread.cpp.
References pthread_spinlock_t::__handle.
|
inlinestatic |
Definition at line 687 of file stk_c_pthread.cpp.
References s_Keys, and STK_C_PTHREAD_KEYS_MAX.
Referenced by pthread_getspecific(), and pthread_setspecific().
|
inlinestatic |
Definition at line 588 of file stk_c_pthread.cpp.
References stk::IKernelService::GetInstance(), and stk::sync::Mutex::GetOwner().
Referenced by PreLockCheck(), pthread_cond_timedwait(), pthread_cond_wait(), pthread_mutex_unlock(), and pthread_once().
|
inlinestatic |
Definition at line 593 of file stk_c_pthread.cpp.
References PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_NORMAL, and PTHREAD_MUTEX_RECURSIVE.
Referenced by pthread_mutex_init(), and pthread_mutexattr_settype().
|
inlinestatic |
Definition at line 219 of file stk_c_pthread.cpp.
Referenced by EnsureObject(), EnsureStackPool(), and pthread_once().
|
static |
Definition at line 382 of file stk_c_pthread.cpp.
References pthread_stk_ctrl_t::detached, EnqueueReap(), pthread_stk_ctrl_t::finished, pthread_stk_ctrl_t::reclaimed, and s_ReapSem.
Referenced by pthread_detach(), pthread_exit(), and stk::pthread::PthreadTask::Run().
|
static |
Definition at line 605 of file stk_c_pthread.cpp.
References pthread_mutex_t::__type, stk::sync::Mutex::GetRecursionCount(), IsMutexOwner(), PTHREAD_MUTEX_ERRORCHECK, and stk::sync::Mutex::RECURSION_MAX.
Referenced by pthread_mutex_lock(), pthread_mutex_timedlock(), and pthread_mutex_trylock().
|
static |
Definition at line 363 of file stk_c_pthread.cpp.
References DequeueReap(), ReleaseThreadResources(), s_ReapSem, STK_C_ASSERT, and WaitForTaskExit().
Referenced by EnsureReaper().
|
static |
Definition at line 453 of file stk_c_pthread.cpp.
References pthread_stk_ctrl_t::busy, pthread_stk_ctrl_t::done_event, free(), s_StackPool, pthread_stk_ctrl_t::stack, pthread_stk_ctrl_t::stack_from_pool, pthread_stk_ctrl_t::stack_owned, stk_blockpool_free(), and stk::sync::Event::~Event().
Referenced by pthread_join(), and ReaperEntry().
|
static |
Definition at line 699 of file stk_c_pthread.cpp.
References PTHREAD_DESTRUCTOR_ITERATIONS, s_Keys, STK_C_PTHREAD_KEYS_MAX, and pthread_stk_ctrl_t::tsd.
Referenced by pthread_exit(), and stk::pthread::PthreadTask::Run().
| stk::pthread::STK_BLOCKPOOL_STORAGE_DECL | ( | s_PthreadStackStorage | , |
| STK_C_PTHREAD_MAX_THREADS | , | ||
| kDefaultStackBytes | ) |
References kDefaultStackBytes, and STK_C_PTHREAD_MAX_THREADS.
|
inlinestatic |
Definition at line 220 of file stk_c_pthread.cpp.
Referenced by EnsureObject(), EnsureStackPool(), and pthread_once().
|
static |
Definition at line 563 of file stk_c_pthread.cpp.
References stk::GetTicksFromMsClampedToTimeout(), and stk::GetTimeNowMs().
Referenced by pthread_cond_timedwait(), pthread_mutex_timedlock(), pthread_rwlock_timedrdlock(), and pthread_rwlock_timedwrlock().
|
inlinestatic |
Definition at line 189 of file stk_c_pthread.cpp.
Referenced by pthread_create(), and pthread_exit().
|
static |
Definition at line 434 of file stk_c_pthread.cpp.
References pthread_stk_ctrl_t::exited, and stk::SleepMs().
Referenced by pthread_join(), and ReaperEntry().
| uint8_t stk::pthread::data[sizeof(sync::Semaphore)] |
Definition at line 300 of file stk_c_pthread.cpp.
|
constexpr |
Definition at line 175 of file stk_c_pthread.cpp.
Referenced by AllocateStack(), EnsureStackPool(), pthread_attr_getstacksize(), pthread_create(), and STK_BLOCKPOOL_STORAGE_DECL().
|
constexpr |
Definition at line 180 of file stk_c_pthread.cpp.
Referenced by pthread_once().
|
constexpr |
Definition at line 179 of file stk_c_pthread.cpp.
Referenced by pthread_once().
|
static |
Definition at line 260 of file stk_c_pthread.cpp.
Referenced by EnsureReaper(), pthread_create(), pthread_exit(), and stk_pthread_bind_kernel().
|
static |
Definition at line 683 of file stk_c_pthread.cpp.
Referenced by IsKeyUsed(), pthread_key_create(), pthread_key_delete(), and RunKeyDestructors().
|
static |
Definition at line 296 of file stk_c_pthread.cpp.
Referenced by DequeueReap(), and EnqueueReap().
|
static |
Definition at line 303 of file stk_c_pthread.cpp.
Referenced by EnsureReaper().
|
static |
Definition at line 302 of file stk_c_pthread.cpp.
Referenced by EnqueueReap(), and EnsureReaper().
|
static |
Definition at line 295 of file stk_c_pthread.cpp.
Referenced by DequeueReap(), and EnqueueReap().
|
static |
Definition at line 294 of file stk_c_pthread.cpp.
Referenced by DequeueReap(), and EnqueueReap().
|
static |
Definition at line 298 of file stk_c_pthread.cpp.
Referenced by EnsureReaper(), MaybeReap(), and ReaperEntry().
| struct { ... } stk::pthread::s_ReapSemBuf |
Referenced by EnsureReaper().
|
static |
Definition at line 266 of file stk_c_pthread.cpp.
Referenced by EnsureStackPool(), and ReleaseThreadResources().
|
static |
Definition at line 182 of file stk_c_pthread.cpp.
Referenced by AcquireThreadSlot().