1 /* Prototypes for condition spinning helper functions (part of libsys). */
5 /* Opaque spin state structure. */
10 clock_t s_base_uptime
;
15 void spin_init(spin_t
*s
, u32_t usecs
);
16 int spin_check(spin_t
*s
);
20 /* Execute a loop for at least 'u' microseconds, using spin object 's'.
21 * The body of the loop is guaranteed to be executed at least once.
23 #define SPIN_FOR(s,u) \
24 for (spin_init((s), (u)); spin_check((s)); )
26 /* Return whether spin object 's' timed out after a loop. */
27 #define SPIN_TIMEOUT(s) ((s)->s_timeout)
29 /* Spin until the given condition becomes true, or 'u' microseconds expired.
30 * The condition is guaranteed to be checked at least once.
32 #define SPIN_UNTIL(c,u) do { \
38 #endif /* _MINIX_SPIN_H */