27 #ifndef EMBB_BASE_THREAD_H_ 28 #define EMBB_BASE_THREAD_H_ 30 #include <embb/base/internal/platform.h> 31 #include <embb/base/internal/thread_closures.h> 32 #include <embb/base/mutex.h> 33 #include <embb/base/core_set.h> 34 #include <embb/base/c/thread.h> 75 explicit ID(internal::IDType
id) : id_(
id) {}
90 template<
class CharT,
class Traits>
92 std::basic_ostream<CharT, Traits>&
93 operator<<(std::basic_ostream<CharT, Traits>& os,
Thread::ID id);
121 unsigned int max_count
160 template<
typename Function>
180 template<
typename Function>
202 template<
typename Function>
227 template<
typename Function,
typename Arg>
251 template<
typename Function,
typename Arg1,
typename Arg2>
286 template<
typename ThreadClosure>
287 void CheckThreadCreationErrors(
290 ThreadClosure* closure
303 internal::ThreadType rep_;
341 template<
class CharT,
class Traits>
342 std::basic_ostream<CharT, Traits>&
344 std::basic_ostream<CharT, Traits>& os,
353 #include <embb/base/internal/thread-inl.h> 355 #endif // EMBB_BASE_THREAD_H_ Definition: lock_free_mpmc_queue.h:40
Represents a set of processor cores, used to set thread-to-core affinities.
Definition: core_set.h:58
Unique ID of a thread that can be compared with other IDs.
Definition: thread.h:64
ID()
Constructs an empty (invalid) thread ID.
Definition: thread.h:69
friend class Thread
A thread needs to set its ID on start.
Definition: thread.h:85
void Join()
Waits until the thread has finished execution.
static ID CurrentGetID()
Returns the ID of the current thread.
static void SetThreadsMaxCount(unsigned int max_count)
Sets the maximum number of threads handled by EMB2.
Wraps function pointers, member function pointers, and functors with up to five arguments.
Definition: function.h:94
Represents a thread of execution.
Definition: thread.h:59
friend bool operator==(Thread::ID lhs, Thread::ID rhs)
Comparison operators need to access the internal ID representation.
static unsigned int GetThreadsMaxCount()
Returns the maximum number of threads handled by EMB2.
friend std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > &os, Thread::ID id)
The streaming operator needs to access the internal ID representation.
embb_thread_priority_t
Thread priority type.
Definition: thread.h:62
static void CurrentYield()
Reschedule the current thread for later execution.
friend bool operator!=(Thread::ID lhs, Thread::ID rhs)
Compares two thread IDs for inequality.
ID GetID()
Returns the thread ID.