MediaProcessors
|
Interruptible usleep module. This module ("interruptible usleep") implements a wrapper to the 'usleep()' function to provide the possibility to interrupt the sleep state by 'unlocking' the module instance handler. More...
#include <sys/types.h>
#include <inttypes.h>
Go to the source code of this file.
Typedefs | |
typedef struct interr_usleep_ctx_s | interr_usleep_ctx_t |
Functions | |
interr_usleep_ctx_t * | interr_usleep_open () |
void | interr_usleep_close (interr_usleep_ctx_t **ref_interr_usleep_ctx) |
void | interr_usleep_unblock (interr_usleep_ctx_t *interr_usleep_ctx) |
int | interr_usleep (interr_usleep_ctx_t *interr_usleep_ctx, uint32_t usec) |
Interruptible usleep module. This module ("interruptible usleep") implements a wrapper to the 'usleep()' function to provide the possibility to interrupt the sleep state by 'unlocking' the module instance handler.
Definition in file interr_usleep.h.
int interr_usleep | ( | interr_usleep_ctx_t * | interr_usleep_ctx, |
uint32_t | usec | ||
) |
Perform the interruptible 'usleep' operation; that is: suspends execution of the calling thread for (at least) usec microseconds. The sleep may be lengthened slightly by any system activity or by the time spent processing the call or by the granularity of system timers.
Pointer | to the interruptible module instance context structure, that was obtained in a previous call to the 'interr_usleep_open()' function. |
usec | Unsigned 32-bit integer specifying the amount of microseconds to sleep. |
Definition at line 133 of file interr_usleep.c.
void interr_usleep_close | ( | interr_usleep_ctx_t ** | ref_interr_usleep_ctx | ) |
Unlock 'usleep' operation -if applicable- and release interruptible module instance context structure.
ref_interr_usleep_ctx | Reference to the pointer to the interruptible module instance context structure to be release, that was obtained in a previous call to the 'interr_usleep_open()' function. Pointer is set to NULL on return. |
Definition at line 102 of file interr_usleep.c.
interr_usleep_ctx_t* interr_usleep_open | ( | ) |
Initializes (open) interruptible module instance.
Definition at line 70 of file interr_usleep.c.
void interr_usleep_unblock | ( | interr_usleep_ctx_t * | interr_usleep_ctx | ) |
Unlock 'usleep' operation.
Pointer | to the interruptible module instance context structure, that was obtained in a previous call to the 'interr_usleep_open()' function. |
Definition at line 122 of file interr_usleep.c.