summaryrefslogtreecommitdiffstats
path: root/src/lib/sleep.h
blob: 0f8d7c30ca5b099a86f2b132aa057def01705f7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef SLEEP_H
#define SLEEP_H

/* Sleep for the indicated number of microseconds. Signal interruptions are
   handled and ignored internally. */
void i_sleep_usecs(unsigned long long usecs);
/* Sleep for the indicated number of milliseconds. Signal interruptions are
   handled and ignored internally. */
void i_sleep_msecs(unsigned int msecs);
/* Sleep for the indicated number of seconds. Signal interruptions are
   handled and ignored internally. */
void i_sleep_secs(time_t secs);

/* Sleep for the indicated number of microseconds while allowing signal
   interruptions. This function returns FALSE when it is interrupted by a
   signal. Otherwise, this function always returns TRUE. */
bool ATTR_NOWARN_UNUSED_RESULT
i_sleep_intr_usecs(unsigned long long usecs);
/* Sleep for the indicated number of milliseconds while allowing signal
   interruptions. This function returns FALSE when it is interrupted by a
   signal. Otherwise, this function always returns TRUE. */
bool ATTR_NOWARN_UNUSED_RESULT
i_sleep_intr_msecs(unsigned int msecs);
/* Sleep for the indicated number of seconds while allowing signal
   interruptions. This function returns FALSE when it is interrupted by a
   signal. Otherwise, this function always returns TRUE. */
bool ATTR_NOWARN_UNUSED_RESULT
i_sleep_intr_secs(time_t secs);

#endif