![]() |
MQTT C Client Libraries Internals
|
Threading related functions. More...
#include "Thread.h"#include "Log.h"#include "StackTrace.h"#include <errno.h>#include <unistd.h>#include <sys/time.h>#include <fcntl.h>#include <stdio.h>#include <sys/stat.h>#include <limits.h>#include <stdlib.h>#include "OsWrapper.h"
Macros | |
| #define | NSEC_PER_SEC 1000000000L |
Functions | |
| void | Paho_thread_start (thread_fn fn, void *parameter) |
| Start a new thread. More... | |
| int | Thread_set_name (const char *thread_name) |
| thread_id_type | Paho_thread_getid (void) |
| Get the thread id of the thread from which this function is called. More... | |
| struct timespec | Thread_time_from_now (int ms) |
| mutex_type | Paho_thread_create_mutex (int *rc) |
| Create a new mutex. More... | |
| int | Paho_thread_lock_mutex (mutex_type mutex) |
| Lock a mutex which has alrea. More... | |
| int | Paho_thread_unlock_mutex (mutex_type mutex) |
| Unlock a mutex which has already been locked. More... | |
| int | Paho_thread_destroy_mutex (mutex_type mutex) |
| Destroy a mutex which has already been created. More... | |
| evt_type | Thread_create_evt (int *rc) |
| Create a new event. More... | |
| int | Thread_signal_evt (evt_type evt) |
| Signal an event. More... | |
| int | Thread_wait_evt (evt_type evt, int timeout_ms) |
| Wait with a timeout (ms) for the event to become signaled. More... | |
| int | Thread_destroy_evt (evt_type evt) |
| Destroy an event object. More... | |
Threading related functions.
Used to create platform independent threading functions
| mutex_type Paho_thread_create_mutex | ( | int * | rc | ) |
Create a new mutex.
| rc | return code: 0 for success, negative otherwise |
| int Paho_thread_destroy_mutex | ( | mutex_type | mutex | ) |
Destroy a mutex which has already been created.
| mutex | the mutex |
| thread_id_type Paho_thread_getid | ( | void | ) |
Get the thread id of the thread from which this function is called.
| int Paho_thread_lock_mutex | ( | mutex_type | mutex | ) |
Lock a mutex which has alrea.
| void Paho_thread_start | ( | thread_fn | fn, |
| void * | parameter | ||
| ) |
Start a new thread.
| fn | the function to run, must be of the correct signature |
| parameter | pointer to the function parameter, can be NULL |
| int Paho_thread_unlock_mutex | ( | mutex_type | mutex | ) |
Unlock a mutex which has already been locked.
| mutex | the mutex |
| evt_type Thread_create_evt | ( | int * | rc | ) |
Create a new event.
| int Thread_destroy_evt | ( | evt_type | evt | ) |
Destroy an event object.
| int Thread_signal_evt | ( | evt_type | evt | ) |
Signal an event.
| int Thread_wait_evt | ( | evt_type | evt, |
| int | timeout_ms | ||
| ) |
Wait with a timeout (ms) for the event to become signaled.
1.8.10