39#ifndef BLOCXX_THREAD_HPP_INCLUDE_GUARD_
40#define BLOCXX_THREAD_HPP_INCLUDE_GUARD_
41#include "blocxx/BLOCXX_config.h"
282 bool timedWait(
const Timeout& timeout);
317 static void sleep(UInt32 milliSeconds)
#define BLOCXX_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
The Condition class represents a synchronization device that allows threads to suspend execution and ...
Note that descriptions of what exceptions may be thrown assumes that object is used correctly,...
Descriptions of exceptions thrown assume that the object is used correctly, i.e., method precondition...
Atomic_t m_cancelRequested
static void sleep(const Timeout &timeout)
Suspend execution of the current thread until the given number of seconds have elapsed.
static void testCancel()
Test if this thread has been cancelled.
Thread()
Create a new Thread object.
virtual void start(const ThreadDoneCallbackRef &cb=ThreadDoneCallbackRef(0))
Start this Thread's execution.
Thread_t getId()
Get this Thread object's id.
void cancel()
Definitively cancel this Threads execution.
Thread & operator=(const Thread &)
NonRecursiveMutex m_stateGuard
void doneRunning(const ThreadDoneCallbackRef &cb)
virtual void doDefinitiveCancel()
See the documentation for doCooperativeCancel().
void shutdown()
Call the thread's doShutdown(), which may be used by the thread to safely stop.
virtual void doCooperativeCancel()
This function is available for subclasses of Thread to override if they wish to be notified when a co...
virtual void doShutdown()
This function is available for subclasses of Thread to override if they wish to be notified when shut...
static Int32 threadRunner(void *paramPtr)
static void yield()
Voluntarily yield to the processor giving the next thread in the chain the opportunity to run.
virtual Int32 run()=0
The method that will be run when the start method is called.
void cancel_internal(bool is_locked)
static void sleep(UInt32 milliSeconds)
Suspend execution of the current thread until the given number of milliSeconds have elapsed.
bool definitiveCancel(const Timeout &timeout=Timeout::relative(60))
Attempt to cooperatively and then definitively cancel this Thread's execution.
void cooperativeCancel()
Attempt to cooperatively cancel this Threads execution.
A timeout can be absolute, which means that it will happen at the specified DateTime.
static Timeout relative(float seconds)
BLOCXX_COMMON_API void testCancel()
Test if this thread has been cancelled.
void yield()
Voluntarily yield to the processor giving the next thread in the chain the opportunity to run.
void sleep(UInt32 milliSeconds)
Suspend execution of the current thread until the given number of milliSeconds have elapsed.
IntrusiveReference< ThreadDoneCallback > ThreadDoneCallbackRef
BLOCXX_EXPORT_TEMPLATE(BLOCXX_COMMON_API, Array, Bool)