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