|
cheshirekow
v0.1.0
|
Wraps posix-threads (pthreads.h) with object oriented API. More...
Classes | |
| struct | Access |
| access delegate, an object which can access an attribute value of an attribute object More... | |
| struct | Assignment |
| assignment delegate, an object which can assign an attribute value to an attribute object More... | |
| class | Attr |
Attributes object for type Base. More... | |
| struct | AttrType |
| template used to resolve the pthreads_xxx_t object corresponding to the Attr<Base> object More... | |
| struct | AttrType< Barrier > |
| A simple way of telling Attr<Barrier> that it's storage type is pthread_barrierattr_t. More... | |
| struct | AttrType< Condition > |
| A simple way of telling Attr<Condition> that it's storage type is pthread_condattr_t. More... | |
| struct | AttrType< Mutex > |
| A simple way of telling Attr<Mutex> that it's storage type is pthread_mutexattr_t. More... | |
| struct | AttrType< Thread > |
| A simple way of telling Attr<Thread> that it's storage type is pthread_attr_t. More... | |
| class | Barrier |
| A barrier is an object which synchronizes a fixed number of threads at a specific point. More... | |
| class | Condition |
| Allows multiple threads to wait until a condition is satisfied. More... | |
| struct | Delegate |
| two-way delegate, may assign or retrieve (unsafely) an attribute value of an attribute object More... | |
| struct | Friendly |
| since a template parameter cannot be a friend (until C++-11) this template simply allows us to work around that limitation More... | |
| class | Key |
| A key is an identifier used to specify a storage location where the thing stored is different for each thread. More... | |
| class | Mutex |
| a mutual exclusion lock More... | |
| class | ScopedLock |
| Points to a locked mutex and unlocks the mutex when destroyed. More... | |
| struct | Stack |
| Simply encapsulates the stack address and size in a single object. More... | |
| class | Thread |
| A thread... presumably you know what this is. More... | |
| struct | TypeWrap |
| Provides a unique type that acts like a native type. More... | |
Typedefs | |
| typedef TypeWrap< clockid_t, 0 > | Clock |
| A unique type which acts just like clockid_t but is distinct in the eyes of the compiler. More... | |
| typedef TypeWrap< std::size_t, 0 > | GuardSize |
| A unique type which acts just like size_t but is distinct in the eyes of the compiler. More... | |
| typedef TypeWrap< int, 0 > | PriorityCeiling |
| A unique type which acts just like an int but is distinct in the eyes of the compiler. More... | |
| typedef TypeWrap< std::size_t, 1 > | StackSize |
| A unique type which acts just like size_t but is distinct in the eyes of the compiler. More... | |
Enumerations | |
| enum | DetachState { DETACHED = 0, JOINABLE = 1, INVALID_DETACH_STATE } |
| controls whether a thread is created in a detached state, meaning that the thread will destroy itself when it finished running, and cannot be joined More... | |
| enum | InheritSched { INHERIT = 0, EXPLICIT = 1, INVALID_INHERIT_SCHED } |
| determines whether a thread inherits it's scheduling policy from the creating thread or if it uses the policy stored in the attribute object More... | |
| enum | Protocol { PRIO_NONE, PRIO_INHERIT, PRIO_PROTECT, INVALID_PROTOCOL } |
| Which progocol is used for priority. More... | |
| enum | PShared { SHARED, PRIVATE, INVALID_PSHARED } |
| indicates whether or not a resource is shared across processes More... | |
| enum | SchedPolicy { OTHER, FIFO, RR, BATCH, IDLE, SPORADIC, INVALID_SCHED_POLICY } |
| if multiple threads are waiting on the same mutex, the Scheduling Policy determines the order in which they are aquired More... | |
| enum | Scope { SYSTEM = 0, PROCESS = 1, INVALID_SCOPE } |
| Signifies process or system scheduling contention scope. More... | |
| enum | Type { NORMAL, ERROR_CHECK, RECURSIVE, DEFAULT, INVALID_TYPE } |
| Types of mutexes. More... | |
Functions | |
| template<class T > | |
| void * | callCallable (void *obj) |
| function which invokes a callable object when that object is passed to launch a thread More... | |
| template<typename Enum > | |
| Enum | getEnum (int val) |
| returns the pthread integer enumerator that corresponds to the specified value More... | |
| template<typename Enum > | |
| int * | getEnumMap () |
| returns pointer to a map from enums to pthread enums (ints) More... | |
| template<typename Enum > | |
| int | mapEnum (Enum val) |
| returns the pthread integer enumerator that corresponds to the specified value More... | |
Variables | |
| const Access< Barrier, PShared > | B_PSHARED |
| provides access to the pshared field of a pthread_barrierattr_t More... | |
| const Access< Condition, PShared > | C_PSHARED |
| provides access to the pshared field of a pthread_condrattr_t More... | |
| const Access< Condition, Clock > | CLOCK |
| provides access to the clock field of a pthread_condrattr_t More... | |
| const Access< Thread, DetachState > | DETACH_STATE |
| provides access to the detachstate field of a pthread_attr_t More... | |
| const Access< Thread, GuardSize > | GUARD_SIZE |
| provides access to the guardsize field of a pthread_attr_t More... | |
| const Access< Thread, InheritSched > | INHERIT_SCHED |
| provides access to the inheritsched field of a pthread_attr_t More... | |
| const Access< Mutex, PShared > | M_PSHARED |
| provides access to the pshared field of a pthread_mutexattr_t More... | |
| const Access< Mutex, PriorityCeiling > | PRIORITY_CEILING |
| provides access to the prioceil field of a pthread_mutexattr_t More... | |
| const Access< Mutex, Protocol > | PROTOCOL |
| provides access to the protocol field of a pthread_mutexattr_t More... | |
| const Access< Thread, SchedPolicy > | SCHED_POLICY |
| provides access to the schedpolicy field of a pthread_attr_t More... | |
| const Access< Thread, Scope > | SCOPE |
| provides access to the scope field of a pthread_attr_t More... | |
| const Access< Thread, Stack > | STACK |
| provides access to the stack field of a pthread_attr_t, including stack address and size More... | |
| const Access< Thread, StackSize > | STACK_SIZE |
| provides access to the stacksize field of a pthread_attr_t More... | |
| const Access< Mutex, Type > | TYPE |
| provides access to the type field of a pthread_mutexattr_t More... | |
Wraps posix-threads (pthreads.h) with object oriented API.
| typedef TypeWrap<clockid_t, 0> pthreads::Clock |
A unique type which acts just like clockid_t but is distinct in the eyes of the compiler.
Definition at line 43 of file condition_attr.h.
| typedef TypeWrap<std::size_t, 0> pthreads::GuardSize |
A unique type which acts just like size_t but is distinct in the eyes of the compiler.
Definition at line 42 of file thread_attr.h.
| typedef TypeWrap<int, 0> pthreads::PriorityCeiling |
A unique type which acts just like an int but is distinct in the eyes of the compiler.
Definition at line 43 of file mutex_attr.h.
| typedef TypeWrap<std::size_t, 1> pthreads::StackSize |
A unique type which acts just like size_t but is distinct in the eyes of the compiler.
Definition at line 46 of file thread_attr.h.
controls whether a thread is created in a detached state, meaning that the thread will destroy itself when it finished running, and cannot be joined
determines whether a thread inherits it's scheduling policy from the creating thread or if it uses the policy stored in the attribute object
| Enumerator | |
|---|---|
| INHERIT |
thread inherits scheduling policy from creating thread |
| EXPLICIT |
thread's scheduling policy is explicitly set in the Attr<Thread> object |
| INVALID_INHERIT_SCHED | |
| enum pthreads::Protocol |
| enum pthreads::PShared |
| enum pthreads::Scope |
| enum pthreads::Type |
| void* pthreads::callCallable | ( | void * | obj | ) |
| Enum pthreads::getEnum | ( | int | val | ) |
returns the pthread integer enumerator that corresponds to the specified value
| int* pthreads::getEnumMap | ( | ) |
returns pointer to a map from enums to pthread enums (ints)
|
inline |
provides access to the pshared field of a pthread_barrierattr_t
provides access to the pshared field of a pthread_condrattr_t
provides access to the clock field of a pthread_condrattr_t
| const Access<Thread, DetachState> pthreads::DETACH_STATE |
provides access to the detachstate field of a pthread_attr_t
provides access to the guardsize field of a pthread_attr_t
| const Access<Thread, InheritSched> pthreads::INHERIT_SCHED |
provides access to the inheritsched field of a pthread_attr_t
provides access to the pshared field of a pthread_mutexattr_t
| const Access<Mutex, PriorityCeiling> pthreads::PRIORITY_CEILING |
provides access to the prioceil field of a pthread_mutexattr_t
provides access to the protocol field of a pthread_mutexattr_t
| const Access<Thread, SchedPolicy> pthreads::SCHED_POLICY |
provides access to the schedpolicy field of a pthread_attr_t
provides access to the stack field of a pthread_attr_t, including stack address and size
provides access to the stacksize field of a pthread_attr_t