thread.h(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

okay so bestie, you just opened thread.h(3) and it's literally the GNU CommonC++ header that hands you synchronization and threading services. πŸ’– No cap, this is the whole page, every flag-adjacent thing, every class, every macro. Let's go. 🧚


🌸 NAME 🌸

thread.h β€” Synchronization and threading services. That's it, that's the vibe. ✨

πŸŽ€ SYNOPSIS πŸŽ€

#include <cc++/config.h>
#include <cc++/string.h>
#include <ctime>
#include <pthread.h>
#include <time.h>
#include <signal.h>
#include <unistd.h>

🫢 Classes

  • class ost::Mutex β€” protects a section of code so that at any given time only a single thread can perform the protected operation. one. thread. at. a. time. πŸ’…
  • class ost::MutexLock β€” same job description, same energy: it guards a section of code so only one thread at any given time can run the protected operation. πŸŽ€
  • class ost::ThreadLock β€” implements a thread rwlock for optimal reader performance on systems that have rwlock support, and reverts to a simple mutex on systems that do not. adaptive queen. ✨
  • class ost::ReadLock β€” protects a section of code through a ThreadLock for 'read' access to the member function.
  • class ost::WriteLock β€” protects a section of code through a ThreadLock for 'write' access to the member function.
  • class ost::MutexCounter β€” a counter variable that can safely be incremented or decremented by multiple threads. πŸ¦‹
  • class ost::AtomicCounter β€” offers thread-safe manipulation of an integer counter. iconic behavior only. πŸ‘‘
  • class ost::Conditional β€” a conditional variable synchronization object for one to one and one to many signal and control events between processes.
  • class ost::Semaphore β€” generally used as a synchronization object between multiple threads, or to protect a limited and finite resource such as a memory or thread pool. πŸ“
  • class ost::SemaphoreLock β€” protects a section of code through a semaphore so that only x instances of the member function may execute concurrently.
  • class ost::Event β€” implements a feature originally found in the WIN32 API: event notification. ✨
  • class ost::Thread β€” every thread of execution in an application is created by instantiating an object of a class derived from the Thread class. main character energy, literally. 🌟
  • class ost::Cancellation β€” a class to automatically set the thread cancellation mode of a member function.
  • class ost::PosixThread β€” (no description, she's mysterious πŸ™ˆ)
  • class ost::ThreadKey β€” lets you create a thread context unique 'pointer' that can be set and retrieved, and can be used to create thread specific data areas for implementing 'thread safe' library routines.
  • class ost::TimerPort β€” timer ports provide synchronized timing events when managed under a 'service thread' such as SocketService.
  • class ost::SysTime β€” used to access non-reentrant date and time functions in the standard C library. 😭 (yes, non-reentrant, we cope)

🌈 Namespaces

  • ost

πŸ“ Macros

#define CCXX_POSIX
#define TIMEOUT_INF   ~((timeout_t) 0)
#define ENTER_CRITICAL   enterMutex();
#define LEAVE_CRITICAL   leaveMutex();
#define ENTER_DEFERRED   setCancel(cancelDeferred);
#define LEAVE_DEFERRED   setCancel(cancelImmediate);
#define psleep(x)   (sleep)(x)

copy these character-for-character bestie, they are Not vibes-based πŸ’…

πŸ¦‹ Typedefs

  • typedef pthread_t cctid_t
  • typedef unsigned long timeout_t

⭐ Functions

  • struct timespec * ost::getTimeout (struct timespec *spec, timeout_t timeout)
  • void ost::wait (signo_t signo)
  • Thread * ost::getThread (void)
  • struct tm * ost::localtime_r (const time_t *t, struct tm *b)
  • char * ost::ctime_r (const time_t *t, char *buf)
  • struct tm * ost::gmtime_r (const time_t *t, struct tm *b)
  • char * ost::asctime_r (const struct tm *tm, char *b)

πŸ’… Variables

  • class __EXPORT ost::Thread
  • class __EXPORT ost::ThreadKey
  • class __EXPORT ost::Conditional
  • class __EXPORT ost::Event

πŸ‘‘ Detailed Description πŸ‘‘

Synchronization and threading services. periodt. πŸ’–

πŸ’€ Macro Definition Documentation πŸ’€

#define CCXX_POSIX

yep. it's defined. that's the whole lore. πŸ™ˆ

#define ENTER_CRITICAL enterMutex();

drop this at the top of your critical section and you're in the club. πŸŽ€

#define ENTER_DEFERRED setCancel(cancelDeferred);

#define LEAVE_CRITICAL leaveMutex();

the matching exit, bestie. always close what you open. πŸ’…

#define LEAVE_DEFERRED setCancel(cancelImmediate);

#define psleep(x) (sleep)(x)

#define TIMEOUT_INF ~((timeout_t) 0)

the "wait forever" sentinel. iconic. ✨

🌈 Typedef Documentation 🌈

typedef pthread_t cctid_t

typedef unsigned long timeout_t


🫢 Author 🫢

Generated automatically by Doxygen for GNU CommonC++ from the source code. (not a human, just a very diligent robot 🧚)


okay that's the whole page bestie, you ate it πŸ’– This was GNU CommonC++, dated Sun Dec 27 2020, and yes it really was generated for you by that Doxygen girlie. go forth and thread safely, no cap πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from