1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/posix/pthread/include/pthread_once.h
René Kijewski e135bdc266 documentation: fix doxygen for pthread_*.h
The pthread header files aren't in the doxygen page anymore after #1137,
because I `@file`'d the `.c` files, not the `.h` files.

This change moves doxygen boilerplate.

Closes #1199.
2014-05-18 17:33:49 +02:00

40 lines
1.2 KiB
C

/**
* @ingroup pthread
* @{
* @file
* @brief Singletons features / single-shot execution.
* @note Do not include this header file directly, but pthread.h.
*/
#ifndef __SYS__POSIX__PTHREAD_ONCE__H
#define __SYS__POSIX__PTHREAD_ONCE__H
/**
* @brief Datatype to supply to pthread_once().
*/
typedef volatile int pthread_once_t;
/**
* @def PTHREAD_ONCE_INIT
* @brief Initialization for pthread_once_t.
* @details A zeroed out pthread_once_t is initialized.
*/
#define PTHREAD_ONCE_INIT 0
/**
* @brief Helper function that ensures that `init_routine` is called at once.
* @details Calling pthread_once() changes `once_control`.
* For the same `once_control` the supplied `init_routine` won't get called again,
* unless `once_control` is reset to #PTHREAD_ONCE_INIT or zeroed out.
* @param[in,out] once_control Flag to ensure that the `init_routine` is called only once.
* @param[in] init_routine Function to call if `once_control` was not used, yet.
* @returns 0, this invocation cannot fail.
*/
int pthread_once(pthread_once_t *once_control, void (*init_routine)(void));
#endif
/**
* @}
*/