29 #ifndef PT_SYSTEM_THREAD_H
30 #define PT_SYSTEM_THREAD_H
32 #include <Pt/System/Api.h>
33 #include <Pt/NonCopyable.h>
34 #include <Pt/Callable.h>
35 #include <Pt/Function.h>
36 #include <Pt/Method.h>
119 bool isJoinable()
const
120 {
return _state == Running; }
156 static void sleep(
unsigned int ms);
170 class ThreadImpl* _impl;
243 Thread::joinNoThrow();
283 typedef void (*FuncPtrT)();
337 #endif // PT_SYSTEM_THREAD_H
State state() const
Returns the current state of the thread.
Definition: Thread.h:116
Protects derived classes from being copied.
Definition: NonCopyable.h:54
AttachedThread()
Default Constructor.
Definition: Thread.h:216
A Joinable thread.
Definition: Thread.h:208
State
Status of a thread.
Definition: Thread.h:68
AttachedThread(const Callable< void > &cb)
Constructs a thread with a thread entry.
Definition: Thread.h:226
A detached thread.
Definition: Thread.h:281
Thread()
Default Constructor.
void init(const Callable< void > &cb)
Initialize with a thread entry.
An interface for all callable entities.
Definition: Callable.h:13
DetachedThread()
Constructs a detached thread.
Definition: Thread.h:301
~AttachedThread()
Joins the thread, if not already joined.
Definition: Thread.h:241
Platform independent threads.
Definition: Thread.h:64
virtual void destroy()
Destroys a detached thread.
Definition: Thread.h:313
Thread-safe event loop supporting I/O multiplexing and Timers.
Definition: EventLoop.h:72
virtual void run()
Thread entry method.
Definition: Thread.h:321
void detach()
Detaches the thread.
AttachedThread(EventLoop &loop)
Constructs a thread with an event loop.
Definition: Thread.h:236