Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
Public Member Functions | Protected Member Functions | List of all members
CThread Class Reference

Description

Class to wrap (POSIX) threads.

The thread routine can be supplied in the following ways:

  1. Instantiate the base class CThread and specifiy a FThreadRoutine function.
  2. Derive a subclass and overload CThread::Run().

Please not, that there is intenionally no 'cancel()' functionality, since this is a) presently not supported under Android, and b) almost certainly introduces inproper code with race conditions.

Definition at line 1697 of file base.H.

#include "base.H"

Public Member Functions

void Start (FThreadRoutine *_routine, void *_data=NULL)
 Run the supplied function _routine in the background passing _data as an argument.
 
void Start ()
 Run the virtual method Run() in the background.
 
void * Join ()
 Join with the background thread.
 
bool IsRunning ()
 (only for main thread)
 

Protected Member Functions

virtual void * Run ()
 Main thread routine (to be overloaded)
 

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