#include "stdint.h"
Functions | |
Clock management | |
uint64_t | dcpl_get_clock (void) |
Return a system clock value. | |
int | dcpl_get_time (uint32_t *s, uint32_t *ns) |
Retrieves the time since 00:00:00 GMT, January 1, 1970. | |
int | dcpl_sleep (uint64_t dly) |
Makes the current thread sleep for a given duration. | |
Process management | |
uint32_t | dcpl_process_id (void) |
Return a process ID used for UUID generation diversification. | |
Mutexes management | |
#define | DC_LOCK_NB 8 |
The number of mutexes used by the dpws stack that may be used to size static memory for the mutexes. | |
typedef void * | dcpl_mutex_t |
An implementation dependent type forward declaration for the mutex (can be replaced by a structure by the implementation). | |
dcpl_mutex_t * | dcpl_mutex_init (void) |
Creates a new mutex for thread synchronization. | |
int | dcpl_mutex_delete (dcpl_mutex_t *mutex) |
Deletes a mutex created using dcpl_mutex_init. | |
int | dcpl_mutex_lock (dcpl_mutex_t *mutex) |
Takes a mutex lock. | |
int | dcpl_mutex_unlock (dcpl_mutex_t *mutex) |
Releases a mutex lock. |
#define DC_LOCK_NB 8 |
The number of mutexes used by the dpws stack that may be used to size static memory for the mutexes.
typedef void* dcpl_mutex_t |
An implementation dependent type forward declaration for the mutex (can be replaced by a structure by the implementation).
uint64_t dcpl_get_clock | ( | void | ) |
Return a system clock value.
int dcpl_get_time | ( | uint32_t * | s, | |
uint32_t * | ns | |||
) |
Retrieves the time since 00:00:00 GMT, January 1, 1970.
If no absolute clock is available on the platform this API should return a boot relative time value. Note that of course, the implementation is responsible to provide the best resolution possible without damaging the system performance, knowing that the minimum resolution expected is 10ms.
[out] | s | The number of seconds since 00:00:00 GMT, January 1, 1970. |
[out] | ns | The remainder in nanoseconds for the returned time. |
int dcpl_sleep | ( | uint64_t | dly | ) |
Makes the current thread sleep for a given duration.
dly | The number of milliseconds for which the thread must be stopped. |
dcpl_mutex_t* dcpl_mutex_init | ( | void | ) |
Creates a new mutex for thread synchronization.
Note that the mutex is not expected to be reentrant.
int dcpl_mutex_delete | ( | dcpl_mutex_t * | mutex | ) |
Deletes a mutex created using dcpl_mutex_init.
mutex | A pointer to the "thread" mutex. |
int dcpl_mutex_lock | ( | dcpl_mutex_t * | mutex | ) |
Takes a mutex lock.
mutex | A pointer to the "thread" mutex. |
int dcpl_mutex_unlock | ( | dcpl_mutex_t * | mutex | ) |
Releases a mutex lock.
mutex | A pointer to the "thread" mutex. |
uint32_t dcpl_process_id | ( | void | ) |
Return a process ID used for UUID generation diversification.