|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
81 return mPriv->join(seconds) == 0;
86 mPriv->stopping =
true;
98 mPriv->stopping =
false;
99 return mPriv->start();
105 return mPriv->stopping;
110 return mPriv->isRunning();
124 return ThreadImpl::getCount();
130 return mPriv->getKey();
135 return ThreadImpl::getKeyOfCaller();
140 return mPriv->setPriority(priority, policy);
145 return mPriv->getPriority();
150 return mPriv->getPolicy();
void threadRelease() override
void beforeStart() override
bool join(double seconds=-1)
The function returns when the thread execution has completed.
static void yield()
Reschedule the execution of current thread, allowing other threads to run.
virtual void threadRelease()
Release method.
virtual void onStop()
Call-back, called while halting the thread (before join).
bool threadInit() override
An abstraction for a thread of execution.
virtual void beforeStart()
Called just before a new thread starts.
long int getKey()
Get a unique identifier for the thread.
~Private() override=default
bool isRunning()
Returns true if the thread is running (Thread::start has been called successfully and the thread has ...
virtual void afterStart(bool success)
Called just after a new thread starts (or fails to start), this is executed by the same thread that c...
static long int getKeyOfCaller()
Get a unique identifier for the calling thread.
void yield()
The calling thread releases its remaining quantum upon calling this function.
virtual void run()=0
Main body of the new thread.
int getPolicy()
Query the current scheduling policy of the thread, if the OS supports that.
bool isStopping()
Returns true if the thread is stopping (Thread::stop has been called).
virtual ~Thread()
Destructor.
An abstraction for a thread of execution.
An interface to the operating system, including Port based communication.
int getPriority()
Query the current priority of the thread, if the OS supports that.
static int getCount()
Check how many threads are running.
bool start()
Start the new thread running.
bool stop()
Stop the thread.
void afterStart(bool success) override
The components from which ports and connections are built.
int setPriority(int priority, int policy=-1)
Set the priority and scheduling policy of the thread, if the OS supports that.
virtual bool threadInit()
Initialization method.