|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
Structure representing a timeout. More...
#include <timeout.h>
Public Member Functions | |
| Timeout (Ticks time) | |
| Constructor, initialises this structure to allow time ticks to elapse. | |
| Timeout (Ticks elapsed, Ticks remaining) | |
| Constructor that initialises both fields, should be used only for initialiser-list initialisation in code that needs to compile as both C and C++. | |
| void | elapse (Ticks time) |
| Update this timeout if time ticks have elapsed. | |
| bool | may_block () |
| Helper indicating whether the owner of this timeout may block. | |
Public Attributes | |
| Ticks | elapsed |
| The time that has elapsed during blocking operations for this timeout structure. | |
| Ticks | remaining |
| The remaining time. | |
Structure representing a timeout.
This is intended to allow a single instance to be chained across blocking calls.
Timeouts may not be stored in the heap. Handling timeout structures that may disappear between sleeping and waking is very complicated and would impact a lot of fast paths. Instead, most functions that take a timeout will simply fail if the timeout is on the heap.
|
inline |
|
inline |
Update this timeout if time ticks have elapsed.
This function saturates the values on overflow.
Definition at line 82 of file timeout.h.
References elapsed, remaining, and UnlimitedTimeout.
|
inline |
| Ticks Timeout::elapsed |
| Ticks Timeout::remaining |
The remaining time.
This is clamped at 0 on subtraction. A special value of UnlimitedTimeout can be set to represent an unlimited timeout.
Definition at line 60 of file timeout.h.
Referenced by elapse(), may_block(), Timeout(), and Timeout().