#include <thread_pthreads.h>
|
typedef pthread_key_t | tlskey_t |
|
typedef int | tlskey_t |
|
|
static void | sleep (int msec) |
|
static void | open_tls (tlskey_t &outkey) |
|
static void | close_tls (tlskey_t k) |
|
static void | set_tls (tlskey_t k, const void *val) |
|
static void * | get_tls (tlskey_t k) |
|
static void | sleep (int msec) |
|
static void | open_tls (tlskey_t &outkey) |
|
static void | close_tls (tlskey_t k) |
|
static void | set_tls (tlskey_t k, void *val) |
|
static void * | get_tls (tlskey_t k) |
|
|
static void * | voidrun (void *arg) |
|
An operating system thread object.
- Author
- Aleksander Demko
◆ thread() [1/4]
scopira::tool::thread::thread |
( |
runnable_i * |
target | ) |
|
runnable_i Constructor.
If you pass a non-null target, that target's run method will be executed on start().
If you pass null, this->run() will be run, so you should descendat from thread and override it to make it do something.
- Parameters
-
target | the runnable target |
- Author
- Aleksander Demko
◆ thread() [2/4]
scopira::tool::thread::thread |
( |
runfunc_t |
func, |
|
|
void * |
arg |
|
) |
| |
function pointer constructor. This version uses a function with argument instead runnable_i objects.
- Parameters
-
func | the runfunc_t... it should return 0 |
arg | the argument that is passed to your function... this should be a this object or something, probably. This may be null (heck, it doesn't even have to be a valid pointer...) |
- Author
- Aleksander Demko
◆ thread() [3/4]
scopira::tool::thread::thread |
( |
runnable_i * |
target | ) |
|
runnable_i Constructor.
If you pass a non-null target, that target's run method will be executed on start().
If you pass null, this->run() will be run, so you should descendat from thread and override it to make it do something.
- Parameters
-
target | the runnable target |
- Author
- Aleksander Demko
◆ thread() [4/4]
scopira::tool::thread::thread |
( |
runfunc_t |
func, |
|
|
void * |
arg |
|
) |
| |
function pointer constructor. This version uses a function with argument instead runnable_i objects.
- Parameters
-
func | the runfunc_t... it should return 0 |
arg | the argument that is passed to your function... this should be a this object or something, probably. This may be null (heck, it doesn't even have to be a valid pointer...) |
- Author
- Aleksander Demko
◆ close_tls() [1/2]
static void scopira::tool::thread::close_tls |
( |
tlskey_t |
k | ) |
|
|
static |
close a TLS slot in all thread instances.
- Author
- Aleksander Demko
◆ close_tls() [2/2]
static void scopira::tool::thread::close_tls |
( |
tlskey_t |
k | ) |
|
|
static |
close a TLS slot in all thread instances.
- Author
- Aleksander Demko
◆ get_tls() [1/2]
static void* scopira::tool::thread::get_tls |
( |
tlskey_t |
k | ) |
|
|
static |
Get a TLS slot of the CURRENT thread. TLS data values default to null (0). Please note that this applies to the active thread, and may not be directed at individual thread objects.
- Author
- Aleksander Demko
◆ get_tls() [2/2]
static void* scopira::tool::thread::get_tls |
( |
tlskey_t |
k | ) |
|
|
static |
Get a TLS slot of the CURRENT thread. TLS data values default to null (0). Please note that this applies to the active thread, and may not be directed at individual thread objects.
- Author
- Aleksander Demko
◆ notify_stop() [1/2]
virtual void scopira::tool::thread::notify_stop |
( |
void |
| ) |
|
|
virtual |
doesnt actually do anything descendant classes might want to implement something if convinient
Implements scopira::tool::job_i.
◆ notify_stop() [2/2]
virtual void scopira::tool::thread::notify_stop |
( |
void |
| ) |
|
|
virtual |
doesnt actually do anything descendant classes might want to implement something if convinient
Implements scopira::tool::job_i.
◆ open_tls() [1/2]
static void scopira::tool::thread::open_tls |
( |
tlskey_t & |
outkey | ) |
|
|
static |
opens a TLS (thread local storage) slot in all current and future threads. You must call this once before doing any set/get calls. The initial value of the storage in each thread instance will be 0 (null).
outkey is where the new key is stored.
- Author
- Aleksander Demko
◆ open_tls() [2/2]
static void scopira::tool::thread::open_tls |
( |
tlskey_t & |
outkey | ) |
|
|
static |
opens a TLS (thread local storage) slot in all current and future threads. You must call this once before doing any set/get calls. The initial value of the storage in each thread instance will be 0 (null).
outkey is where the new key is stored.
- Author
- Aleksander Demko
◆ set_tls() [1/2]
static void scopira::tool::thread::set_tls |
( |
tlskey_t |
k, |
|
|
const void * |
val |
|
) |
| |
|
static |
Set a TLS slot of the CURRENT thread. TLS data values default to null (0). Please note that this applies to the active thread, and may not be directed at individual thread objects.
- Author
- Aleksander Demko
◆ set_tls() [2/2]
static void scopira::tool::thread::set_tls |
( |
tlskey_t |
k, |
|
|
void * |
val |
|
) |
| |
|
static |
Set a TLS slot of the CURRENT thread. TLS data values default to null (0). Please note that this applies to the active thread, and may not be directed at individual thread objects.
- Author
- Aleksander Demko
◆ sleep() [1/2]
static void scopira::tool::thread::sleep |
( |
int |
msec | ) |
|
|
static |
cause the current thread to sleep
- Parameters
-
msec | the number of msec (1000=second) to wait |
- Returns
- true if got a notification event, false if timed out
◆ sleep() [2/2]
static void scopira::tool::thread::sleep |
( |
int |
msec | ) |
|
|
static |
cause the current thread to sleep
- Parameters
-
msec | the number of msec (1000=second) to wait |
- Returns
- true if got a notification event, false if timed out
The documentation for this class was generated from the following files: