ARC SDK
Public Member Functions
Arc::ThreadRegistry Class Reference

A set of conditions, mutexes, etc. conveniently exposed to monitor running child threads and to wait till they exit. More...

#include <arc/Thread.h>

Public Member Functions

void RegisterThread (void)
 Register thread as started/starting into this instance. More...
 
void UnregisterThread (void)
 Report thread as exited. More...
 
bool WaitOrCancel (int timeout)
 Wait for timeout milliseconds or cancel request. More...
 
bool WaitForExit (int timeout=-1)
 Wait for registered threads to exit. More...
 
void RequestCancel (void)
 Send cancel request to registered threads. More...
 
void forceReset (void)
 This method is meant to be used only after fork. More...
 

Detailed Description

A set of conditions, mutexes, etc. conveniently exposed to monitor running child threads and to wait till they exit.

There are no protections against race conditions, so use it carefully.

Member Function Documentation

◆ forceReset()

void Arc::ThreadRegistry::forceReset ( void  )
inline

This method is meant to be used only after fork.

It resets state of all internal locks and variables.

◆ RegisterThread()

void Arc::ThreadRegistry::RegisterThread ( void  )

Register thread as started/starting into this instance.

◆ RequestCancel()

void Arc::ThreadRegistry::RequestCancel ( void  )

Send cancel request to registered threads.

◆ UnregisterThread()

void Arc::ThreadRegistry::UnregisterThread ( void  )

Report thread as exited.

◆ WaitForExit()

bool Arc::ThreadRegistry::WaitForExit ( int  timeout = -1)

Wait for registered threads to exit.

Leave after timeout milliseconds if failed.

Returns
true if all registered threads reported their exit.

◆ WaitOrCancel()

bool Arc::ThreadRegistry::WaitOrCancel ( int  timeout)

Wait for timeout milliseconds or cancel request.

Returns
true if cancel request received.

The documentation for this class was generated from the following file: