sleep.h 503 B

1234567891011121314151617181920
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <linux/wait.h>
  3. /*
  4. * Do not use. This is a replacement for the old
  5. * "interruptible_sleep_on_timeout" function that has been
  6. * deprecated for ages. All users should instead try to use
  7. * wait_event_interruptible_timeout.
  8. */
  9. static inline long
  10. oss_broken_sleep_on(wait_queue_head_t *q, long timeout)
  11. {
  12. DEFINE_WAIT(wait);
  13. prepare_to_wait(q, &wait, TASK_INTERRUPTIBLE);
  14. timeout = schedule_timeout(timeout);
  15. finish_wait(q, &wait);
  16. return timeout;
  17. }