ost::PosixThread(3)
π¦ ost::PosixThread β¨
okay bestie, so this is a page straight out of the Library Functions Manual (section 3, if you're keeping score) and it's all about ost::PosixThread π
she's a whole class, and honestly? she's iconic.
πΈ NAME πΈ
ost::PosixThread β the Posix flavor of threads, no cap π
π SYNOPSIS π
#include <thread.h>
she Inherits ost::Thread β so like, she came from somewhere, she's got lineage π
π Public Member Functions π
PosixThread(int pri=0, size_t stack=0)β the constructor, she's born πΌvoid signalThread(int signo)β Delivers a Posix signal to the current thread. like, right here, right now, to whoever's holding the mic π€
β Static Public Member Functions β
static void sigInstall(int signo)β Install a signal handler for use by threads and theOnSignal()event notification handler. one-time setup vibes π«Ά
π₯ Protected Member Functions π₯
void signalParent(signo_t signo)β In the Posix version of Common C++, this can be used to send a signal into the parent thread of the current object. hi mom πvoid signalMain(signo_t signo)β In the Posix version of Common C++, this can be used to send a signal into the main application thread. hi main character β¨virtual void onTimer(void)β A derivable method to call when aSIGALRMis being delivered to a specific thread. β°virtual void onHangup(void)β A derived method to handle hangup events being delivered to a specific thread. bye bestie πvirtual void onException(void)β A derived method to call when aSIGABRTis being delivered to a specific thread. screaming crying etc πvirtual void onDisconnect(void)β A derived method to call when aSIGPIPEis being delivered to a specific thread. she left the chat πͺvirtual void onPolling(void)β A derived method to handle asynchronous I/O requests delivered to the specified thread. the way she pollsβ¦ πvirtual void onSignal(int)β A derivable method to call for delivering a signal event to a specified thread. π£void setTimer(timeout_t timer, bool periodic=false)β Used to specify a timeout event that can be delivered to the current thread viaSIGALRM. β³timeout_t getTimer(void) constβ Gets the time remaining for the current threads timer before it expires. how much time we got left, queen? β±οΈvoid endTimer(void)β Terminates the timer before the timeout period has expired. βοΈvoid setSignal(int signo, bool active)β Used to enable or disable a signal within the current thread. on/off, simple as ποΈpthread_attr_t * getPthreadAttrPtr(void)β Access topthread_attrstructure this allows setting/modifying pthread attributes not covered in the platform independantThreadconstructor, e.g. π§pthread_t getPthreadId(void)β Getpthread_tof underlying posix thread (useful for debugging/logging) π
π Friends π
class ThreadImplclass Thread
π Additional Inherited Members π
yep, there's more where that came from, she inherits a whole other set π
π§ Constructor & Destructor Documentation π§
ost::PosixThread::PosixThread (int pri = 0, size_t stack = 0)
that's it, that's the constructor. give her a priority and a stack and let her cook π₯
π Member Function Documentation π
void ost::PosixThread::endTimer (void) [protected]
Terminates the timer before the timeout period has expired. This prevents the timer from sending it's SIGALRM and makes the timer available to other threads. no more alarms, she's free, and somebody else can have her π
pthread_attr_t* ost::PosixThread::getPthreadAttrPtr (void) [protected]
Access to pthread_attr structure this allows setting/modifying pthread attributes not covered in the platform independant Thread constructor, e.g. contention scope or scheduling policy ποΈ
pthread_t ost::PosixThread::getPthreadId (void) [protected]
Get pthread_t of underlying posix thread (useful for debugging/logging) π
timeout_t ost::PosixThread::getTimer (void) const [protected]
Gets the time remaining for the current threads timer before it expires.
Returns
time remaining before timer expires in milliseconds. π°οΈ
virtual void ost::PosixThread::onDisconnect (void) [protected], [virtual]
A derived method to call when a SIGPIPE is being delivered to a specific thread. πͺπ¨
virtual void ost::PosixThread::onException (void) [protected], [virtual]
A derived method to call when a SIGABRT is being delivered to a specific thread. π¨
virtual void ost::PosixThread::onHangup (void) [protected], [virtual]
A derived method to handle hangup events being delivered to a specific thread. π΄
virtual void ost::PosixThread::onPolling (void) [protected], [virtual]
A derived method to handle asynchronous I/O requests delivered to the specified thread. π
virtual void ost::PosixThread::onSignal (int) [protected], [virtual]
A derivable method to call for delivering a signal event to a specified thread.
Parameters
- posix signal id. π
virtual void ost::PosixThread::onTimer (void) [protected], [virtual]
A derivable method to call when a SIGALRM is being delivered to a specific thread. β°β¨
void ost::PosixThread::setSignal (int signo, bool active) [protected]
Used to enable or disable a signal within the current thread.
Parameters
signoposix signal id.activeset to true to enable. β
void ost::PosixThread::setTimer (timeout_t timer, bool periodic = false) [protected]
Used to specify a timeout event that can be delivered to the current thread via SIGALRM. When the timer expires, the onTimer() method is called for the thread. At present, only one thread timer can be active at any given time. On some operating systems (including Linux) a timer can be active on each thread. β³
Parameters
timertimeout in milliseconds.periodicshould the timer be periodic. π
Note: currently, periodic timers are only available on systems with a working setitimer call. lowkey a whole limitation, fr fr π
static void ost::PosixThread::sigInstall (int signo) [static]
Install a signal handler for use by threads and the OnSignal() event notification handler.
Parameters
signoposix signal id. π«Ά
void ost::PosixThread::signalMain (signo_t signo) [inline], [protected]
In the Posix version of Common C++, this can be used to send a signal into the main application thread.
Parameters
signoa posix signal id. π
void ost::PosixThread::signalParent (signo_t signo) [inline], [protected]
In the Posix version of Common C++, this can be used to send a signal into the parent thread of the current object.
Parameters
signoa posix signal id. π©π§
void ost::PosixThread::signalThread (int signo) [inline]
Delivers a Posix signal to the current thread.
Parameters
signoa posix signal id. π¬
π Friends And Related Function Documentation π
- friend class
Thread[friend]π€ - friend class
ThreadImpl[friend]π€
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code. (not me writing this by hand bestie, the robot did it π€β¨)
and that's the whole page, you ate that π«Ά this was the GNU CommonC++ manual page, dated Sun Dec 27 2020, ost::PosixThread(3) β periodt π
π
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms