RTE OSAdapter POSIX 0.1.0 build 41b3eb3
POSIX/Linux OAL OSAdapter for Platform_RTE
Loading...
Searching...
No Matches
rte_posix_osadapter_period.h
Go to the documentation of this file.
1
45#ifndef RTE_POSIX_OSADAPTER_PERIOD_H
46#define RTE_POSIX_OSADAPTER_PERIOD_H
47
48#include <signal.h>
49#include <stdbool.h>
50#include <time.h>
51
52#include "rte/utils/status/rte_status.h"
53#include "rte/utils/types/rte_types.h"
54
65rte_status_t posix_period_init(struct timespec *out_deadline);
66
75void posix_period_advance(struct timespec *deadline, rte_duration_ms_t period_ms);
76
101rte_status_t posix_period_sleep_until(const struct timespec *deadline, const volatile sig_atomic_t *should_stop);
102
113bool posix_period_wake_ready(void);
114
126void posix_period_wake_all(volatile sig_atomic_t *should_stop);
127
128#endif /* RTE_POSIX_OSADAPTER_PERIOD_H */
rte_status_t posix_period_init(struct timespec *out_deadline)
Starts a period: reads CLOCK_MONOTONIC into the deadline.
void posix_period_wake_all(volatile sig_atomic_t *should_stop)
Requests a stop of a periodic thread and wakes it from its wait.
bool posix_period_wake_ready(void)
Creates the process-wide wake object on the first call; true once it exists.
rte_status_t posix_period_sleep_until(const struct timespec *deadline, const volatile sig_atomic_t *should_stop)
Waits until the absolute CLOCK_MONOTONIC deadline, or until a stop is requested.
void posix_period_advance(struct timespec *deadline, rte_duration_ms_t period_ms)
Moves the deadline one period later, keeping tv_nsec in [0, 1 s).