MIRA
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::sleep(mira::Duration::milliseconds(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 MIRA_BASE_EXPORT getCPUUsage ()
 Returns the CPU usage of the calling process in percent. More...
 

Detailed Description


For detailed information see Threads.

Macro Definition Documentation

◆ MIRA_SLEEP

#define MIRA_SLEEP (   ms)    mira::sleep(mira::Duration::milliseconds(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:96

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_BASE_EXPORT mira::getCPUUsage ( )

Returns the CPU usage of the calling process in percent.