Main MRPT website > C++ reference for MRPT 1.9.9
Macros | Typedefs | Enumerations | Functions
xsthread.h File Reference
#include "xstime.h"
#include <windows.h>
Include dependency graph for xsthread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WINVER   0x0502
 
#define _WIN32_WINNT   0x0502
 
#define _WIN32_WINDOWS   0x0410
 
#define _WIN32_IE   0x0600
 
#define XSENS_THREAD_RETURN   DWORD
 
#define XSENS_THREAD_TYPE   WINAPI
 
#define XSENS_THREAD_PARAM   LPVOID
 
#define XSENS_INVALID_THREAD   INVALID_HANDLE_VALUE
 
#define xsYield()   Sleep(0)
 Release the remainder of the timeslice so other operations can run. On Windows this is done using Sleep(0), since this is the most reliable method. SwitchToThread can cause delays since it does not allow the thread to resume on a different core. Sleep http://msdn.microsoft.com/en-us/library/ms686298%28v=vs.85%29.aspx SwitchToThread http://msdn.microsoft.com/en-us/library/ms686352%28v=vs.85%29.aspx. More...
 
#define xsStartThread(func, param, pid)   CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)func, param, 0, pid)
 Start a function as a thread. More...
 
#define xsGetCurrentThreadId()   GetCurrentThreadId()
 
#define xsGetCurrentThreadHandle()   GetCurrentThread()
 
#define xsSuspendThread(thrd)   SuspendThread(thrd)
 
#define xsResumeThread(thrd)   ResumeThread(thrd)
 
#define xsSetThreadPriority(thrd, prio)   SetThreadPriority(thrd, prio)
 
#define xsGetThreadPriority(thrd)   GetThreadPriority(thrd)
 

Typedefs

typedef HANDLE XsThread
 A handle for a thread. More...
 
typedef DWORD XsThreadId
 
typedef enum XsThreadPriority XsThreadPriority
 

Enumerations

enum  XsThreadPriority {
  XS_THREAD_PRIORITY_LOWEST = THREAD_PRIORITY_IDLE, XS_THREAD_PRIORITY_LOWER = THREAD_PRIORITY_LOWEST, XS_THREAD_PRIORITY_LOW = THREAD_PRIORITY_BELOW_NORMAL, XS_THREAD_PRIORITY_NORMAL = THREAD_PRIORITY_NORMAL,
  XS_THREAD_PRIORITY_HIGH = THREAD_PRIORITY_ABOVE_NORMAL, XS_THREAD_PRIORITY_HIGHER = THREAD_PRIORITY_HIGHEST, XS_THREAD_PRIORITY_HIGHEST = THREAD_PRIORITY_TIME_CRITICAL
}
 Thread priorities for xsSetThreadPriority() and xsGetThreadPriority() More...
 

Functions

XSTYPES_DLL_API void xsNameThisThread (const char *threadName)
 

Macro Definition Documentation

◆ _WIN32_IE

#define _WIN32_IE   0x0600

Definition at line 48 of file xsthread.h.

◆ _WIN32_WINDOWS

#define _WIN32_WINDOWS   0x0410

Definition at line 42 of file xsthread.h.

◆ _WIN32_WINNT

#define _WIN32_WINNT   0x0502

Definition at line 35 of file xsthread.h.

◆ WINVER

#define WINVER   0x0502

Definition at line 29 of file xsthread.h.

◆ XSENS_INVALID_THREAD

#define XSENS_INVALID_THREAD   INVALID_HANDLE_VALUE

Definition at line 77 of file xsthread.h.

◆ XSENS_THREAD_PARAM

#define XSENS_THREAD_PARAM   LPVOID

Definition at line 75 of file xsthread.h.

◆ XSENS_THREAD_RETURN

#define XSENS_THREAD_RETURN   DWORD

Definition at line 73 of file xsthread.h.

◆ XSENS_THREAD_TYPE

#define XSENS_THREAD_TYPE   WINAPI

Definition at line 74 of file xsthread.h.

◆ xsGetCurrentThreadHandle

#define xsGetCurrentThreadHandle ( )    GetCurrentThread()

Definition at line 105 of file xsthread.h.

◆ xsGetCurrentThreadId

#define xsGetCurrentThreadId ( )    GetCurrentThreadId()

Definition at line 104 of file xsthread.h.

◆ xsGetThreadPriority

#define xsGetThreadPriority (   thrd)    GetThreadPriority(thrd)

Definition at line 109 of file xsthread.h.

◆ xsResumeThread

#define xsResumeThread (   thrd)    ResumeThread(thrd)

Definition at line 107 of file xsthread.h.

◆ xsSetThreadPriority

#define xsSetThreadPriority (   thrd,
  prio 
)    SetThreadPriority(thrd, prio)

Definition at line 108 of file xsthread.h.

◆ xsStartThread

#define xsStartThread (   func,
  param,
  pid 
)    CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)func, param, 0, pid)

Start a function as a thread.

Definition at line 99 of file xsthread.h.

◆ xsSuspendThread

#define xsSuspendThread (   thrd)    SuspendThread(thrd)

Definition at line 106 of file xsthread.h.

◆ xsYield

#define xsYield ( )    Sleep(0)

Release the remainder of the timeslice so other operations can run. On Windows this is done using Sleep(0), since this is the most reliable method. SwitchToThread can cause delays since it does not allow the thread to resume on a different core. Sleep http://msdn.microsoft.com/en-us/library/ms686298%28v=vs.85%29.aspx SwitchToThread http://msdn.microsoft.com/en-us/library/ms686352%28v=vs.85%29.aspx.

Definition at line 88 of file xsthread.h.

Typedef Documentation

◆ XsThread

typedef HANDLE XsThread

A handle for a thread.

Definition at line 91 of file xsthread.h.

◆ XsThreadId

typedef DWORD XsThreadId

Definition at line 95 of file xsthread.h.

◆ XsThreadPriority

Definition at line 170 of file xsthread.h.

Function Documentation

◆ xsNameThisThread()

XSTYPES_DLL_API void xsNameThisThread ( const char *  threadName)



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST