| 741 | } |
| 742 | |
| 743 | static void |
| 744 | abs_timeout_init(struct abs_timeout *timo, int clockid, int absolute, |
| 745 | const struct timespec *timeout) |
| 746 | { |
| 747 | |
| 748 | timo->clockid = clockid; |
| 749 | if (!absolute) { |
| 750 | timo->is_abs_real = false; |
| 751 | abs_timeout_update(timo); |
| 752 | timespecadd(&timo->cur, timeout, &timo->end); |
| 753 | } else { |
| 754 | timo->end = *timeout; |
| 755 | timo->is_abs_real = clockid == CLOCK_REALTIME || |
| 756 | clockid == CLOCK_REALTIME_FAST || |
| 757 | clockid == CLOCK_REALTIME_PRECISE; |
| 758 | /* |
| 759 | * If is_abs_real, umtxq_sleep will read the clock |
| 760 | * after setting td_rtcgen; otherwise, read it here. |
| 761 | */ |
| 762 | if (!timo->is_abs_real) { |
| 763 | abs_timeout_update(timo); |
| 764 | } |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | static void |
| 769 | abs_timeout_init2(struct abs_timeout *timo, const struct _umtx_time *umtxtime) |
no test coverage detected