ost::PosixThread(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ¦‹ 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 the OnSignal() 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 a SIGALRM is 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 a SIGABRT is being delivered to a specific thread. screaming crying etc 😭
  • virtual void onDisconnect(void) β€” A derived method to call when a SIGPIPE is 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 via SIGALRM. ⏳
  • 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 to pthread_attr structure this allows setting/modifying pthread attributes not covered in the platform independant Thread constructor, e.g. πŸ”§
  • pthread_t getPthreadId(void) β€” Get pthread_t of underlying posix thread (useful for debugging/logging) πŸ›

🌈 Friends 🌈

  • class ThreadImpl
  • class 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

  • signo posix signal id.
  • active set 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

  • timer timeout in milliseconds.
  • periodic should 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

  • signo posix 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

  • signo a 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

  • signo a posix signal id. πŸ‘©πŸ‘§

void ost::PosixThread::signalThread (int signo) [inline]

Delivers a Posix signal to the current thread.

Parameters

  • signo a posix signal id. πŸ“¬

  • 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