+ * called if it is to persist.
+ *
+ * ('where' is used in debug logging. Commonly one would use poll_timer_wait()
+ * to automatically provide the caller's source file and line number for
+ * 'where'.) */
+void
+poll_timer_wait_at(long long int msec, const char *where)
+{
+ long long int now = time_msec();
+ long long int when;
+
+ if (msec <= 0) {
+ /* Wake up immediately. */
+ when = LLONG_MIN;
+ } else if ((unsigned long long int) now + msec <= LLONG_MAX) {
+ /* Normal case. */
+ when = now + msec;
+ } else {
+ /* now + msec would overflow. */
+ when = LLONG_MAX;
+ }
+
+ poll_timer_wait_until_at(when, where);
+}
+
+/* Causes the following call to poll_block() to wake up when the current time,
+ * as returned by time_msec(), reaches 'when' or later. If 'when' is earlier
+ * than the current time, the following call to poll_block() will not block at
+ * all.
+ *
+ * The timer registration is one-shot: only the following call to poll_block()
+ * is affected. The timer will need to be re-registered after poll_block() is
+ * called if it is to persist.
+ *
+ * ('where' is used in debug logging. Commonly one would use
+ * poll_timer_wait_until() to automatically provide the caller's source file
+ * and line number for 'where'.) */