MIRA
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Macros | Typedefs | Functions
Thread


For detailed information see Threads. More...

Collaboration diagram for Thread:

Classes

class  CyclicRunnable
 This class extends threads by the ability to execute an operation repeatedly in an defined interval. More...
 
class  ThreadMonitor
 A thread monitor class. More...
 

Macros

#define MIRA_SLEEP(ms)   mira::MIRA_SLEEP_IMPL(ms);
 Sleeps for ms milliseconds This is a thread interruption point - if interruption of the current thread has been requested, its execution will terminate. More...
 
#define MIRA_DISABLE_THREAD_INTERRUPT   disable_interruption _disable_interruption_USE_ONLY_ONCE_PER_SCOPE_;
 Disable interruption of the current thread in the scope where this is placed. More...
 
#define MIRA_SLEEP_NO_INTERRUPT(ms)
 Sleeps for ms milliseconds, thread interruption is disabled for this time (but not beyond). More...
 

Typedefs

typedef uint32 ThreadID
 Platform independent thread ID. More...
 

Functions

float getCPUUsage ()
 Returns the CPU usage of the calling process in percent. More...
 
ThreadID getCurrentThreadID ()
 Get the ID of the current thread. More...
 

Detailed Description


For detailed information see Threads.

Macro Definition Documentation

◆ MIRA_SLEEP

#define MIRA_SLEEP (   ms)    mira::MIRA_SLEEP_IMPL(ms);

Sleeps for ms milliseconds This is a thread interruption point - if interruption of the current thread has been requested, its execution will terminate.

See https://www.boost.org/doc/libs/1_54_0/doc/html/thread/thread_management.html#thread.thread_management.tutorial.interruption

◆ MIRA_DISABLE_THREAD_INTERRUPT

#define MIRA_DISABLE_THREAD_INTERRUPT   disable_interruption _disable_interruption_USE_ONLY_ONCE_PER_SCOPE_;

◆ MIRA_SLEEP_NO_INTERRUPT

#define MIRA_SLEEP_NO_INTERRUPT (   ms)
Value:
{ \
}
#define MIRA_SLEEP(ms)
Sleeps for ms milliseconds This is a thread interruption point - if interruption of the current threa...
Definition: Thread.h:97

Sleeps for ms milliseconds, thread interruption is disabled for this time (but not beyond).

Typedef Documentation

◆ ThreadID

typedef uint32 ThreadID

Platform independent thread ID.

The ID of the current thread can be obtained using the getCurrentThreadID() method.

Function Documentation

◆ getCPUUsage()

float mira::getCPUUsage ( )

Returns the CPU usage of the calling process in percent.

◆ getCurrentThreadID()

ThreadID mira::getCurrentThreadID ( )
inline

Get the ID of the current thread.

Returns
thread ID