71 #if !defined(SWIG) || defined(SWIG_THREADING) // Do not read when in swig and not in the threading module
78 #define WINAPI __stdcall
97 #if defined(_MEZZ_THREAD_WIN32_)
103 #if defined(_MEZZ_THREAD_WIN32_)
113 #if defined(_MEZZ_WIN32_)
122 explicit Thread(
void (*aFunction)(
void *));
132 Thread(
void (*aFunction)(
void *),
void * aArg);
149 bool joinable()
const;
173 static unsigned hardware_concurrency();
177 #ifdef _MEZZ_CPP11_PARTIAL_
184 #ifdef _MEZZ_CPP11_PARTIAL_
191 native_handle_type mHandle;
192 mutable Mutex mDataMutex;
194 #if defined(_MEZZ_THREAD_WIN32_)
195 unsigned int mWin32ThreadID;
198 #if defined(_MEZZ_THREAD_WIN32_)
200 static unsigned WINAPI wrapper_function(
void * aArg);
203 static void * wrapper_function(
void * aArg);
242 {
return (aId1.mId == aId2.mId); }
249 {
return (aId1.mId != aId2.mId); }
256 {
return (aId1.mId <= aId2.mId); }
263 {
return (aId1.mId < aId2.mId); }
270 {
return (aId1.mId >= aId2.mId); }
277 {
return (aId1.mId > aId2.mId); }
294 unsigned long int mId;
298 namespace this_thread
ThreadId MEZZ_LIB get_id()
Return the thread ID of the calling thread.
friend bool operator<(const ThreadId &aId1, const ThreadId &aId2)
Greater than Comparison.
ThreadId(const ThreadId &aId)
Copy constructor.
ThreadId()
Default constructor.
pthread_t native_handle_type
The native handle type, made available with requiring specific knowledge of whether it is a posix or ...
#define WINAPI
Used to force the aclling convention of a function to match the way windows does it.
A cross-platform abstraction of the OS's mutex.
void MEZZ_LIB yield()
Yield execution to another thread.
std::ostream & operator<<(std::ostream &stream, const Mezzanine::HashedString32 &x)
Send a HashedString32 down a stream serialized.
native_handle_type native_handle()
Get the native handle for this thread.
friend bool operator!=(const ThreadId &aId1, const ThreadId &aId2)
Inequality Comparison.
A small wrapper around the system thread.
friend bool operator>=(const ThreadId &aId1, const ThreadId &aId2)
Less than or equal to Comparison.
uint32_t UInt32
An 32-bit unsigned integer.
friend bool operator==(const ThreadId &aId1, const ThreadId &aId2)
Equality Comparison.
void MEZZ_LIB sleep_for(UInt32 MicroSeconds)
Blocks the calling thread for a period of time.
Thread()
Default constructor.
This file declares and defines a mutex that is a partial implementation.
ThreadId & operator=(const ThreadId &aId)
Assignment Operator.
This file defines a minimalistic cross-platform thread that the scheduler uses to schedule tasks...
ThreadId(unsigned long int aId)
Creation from long.
The bulk of the engine components go in this namspace.
friend bool operator<=(const ThreadId &aId1, const ThreadId &aId2)
Greater than or equal to Comparison.
The thread ID is a unique identifier for each thread.
friend bool operator>(const ThreadId &aId1, const ThreadId &aId2)
Less than Comparison.