Fixposition SDK 0.0.0-heads/main-0-gd0a6ce2
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
fpsdk::common::thread Namespace Reference

Thread helpers. More...

Classes

class  BinarySemaphore
 A binary semaphore, useful for thread synchronisation. More...
 
class  Thread
 Helper class for handling threads. More...
 

Enumerations

enum class  WaitRes { WOKEN , TIMEOUT }
 Thread sleep result. More...
 

Functions

void SetThreadName (const std::string &name)
 Set thread name.
 
std::size_t ThisThreadId ()
 Get numeric thread ID.
 

Detailed Description

Thread helpers.

Enumeration Type Documentation

◆ WaitRes

enum class fpsdk::common::thread::WaitRes
strong

Thread sleep result.

Enumerator
WOKEN 

Thread was woken up (sleep interrupted), or semaphore was taken (wait interrupted)

TIMEOUT 

Sleep or wait timeout has expired (no wakeup, no interrupt)

Definition at line 46 of file thread.hpp.

Function Documentation

◆ SetThreadName()

void fpsdk::common::thread::SetThreadName ( const std::string & name)

Set thread name.

Sets the thread name, which shows in htop etc.

Parameters
[in]nameThe thread name (1-6 characters, longer name is clipped at 6 chars)

◆ ThisThreadId()

std::size_t fpsdk::common::thread::ThisThreadId ( )

Get numeric thread ID.

Like std::this_thread::get_id(), but numeric (and therefore printf()-able, etc.).