Lines Matching +full:timeout +full:- +full:ms
1 /*-
43 const char *wmesg, int timeout, int state)
53 if (timeout != 0)
54 sleepq_set_timeout(wchan, timeout);
58 if (timeout == 0)
59 ret = -sleepq_wait_sig(wchan, 0);
61 ret = -sleepq_timedwait_sig(wchan, 0);
63 if (timeout == 0) {
67 ret = -sleepq_timedwait(wchan, 0);
72 if (ret != 0 && ret != -EWOULDBLOCK) {
74 ret = -ERESTARTSYS;
80 linux_msleep_interruptible(unsigned int ms)
85 if (ms == 0)
86 ms = 1;
87 ret = -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH);
90 case -EWOULDBLOCK:
94 return (ms);
105 if ((atomic_read(&task->state) & state) != 0) {
120 td = task->task_thread;
121 PROC_LOCK(td->td_proc);
122 pending = td->td_siglist;
123 SIGSETOR(pending, td->td_proc->p_siglist);
124 SIGSETNAND(pending, td->td_sigmask);
125 PROC_UNLOCK(td->td_proc);
135 td = task->task_thread;
136 PROC_LOCK(td->td_proc);
137 ret = SIGISMEMBER(td->td_siglist, SIGKILL) ||
138 SIGISMEMBER(td->td_proc->p_siglist, SIGKILL);
139 PROC_UNLOCK(td->td_proc);
159 td = task->task_thread;
160 PROC_LOCK(td->td_proc);
162 PROC_UNLOCK(td->td_proc);
172 task = wq->private;
174 list_del_init(&wq->task_list);
182 return (wake_up_task(wq->private, state));
190 wq->flags = flags;
191 wq->private = current;
192 wq->func = autoremove_wake_function;
193 INIT_LIST_HEAD(&wq->task_list);
202 spin_lock(&wqh->lock);
203 list_for_each_entry_safe(pos, next, &wqh->task_list, task_list) {
204 if (pos->func == NULL) {
205 if (wake_up_task(pos->private, state) != 0 && --nr == 0)
208 if (pos->func(pos, state, 0, NULL) != 0 && --nr == 0)
213 spin_unlock(&wqh->lock);
220 spin_lock(&wqh->lock);
221 if (list_empty(&wq->task_list))
224 spin_unlock(&wqh->lock);
231 spin_lock(&wqh->lock);
233 if (!list_empty(&wq->task_list)) {
235 INIT_LIST_HEAD(&wq->task_list);
237 spin_unlock(&wqh->lock);
245 spin_lock(&wqh->lock);
246 ret = !list_empty(&wqh->task_list);
247 spin_unlock(&wqh->lock);
252 linux_wait_event_common(wait_queue_head_t *wqh, wait_queue_t *wq, int timeout,
261 /* range check timeout */
262 if (timeout < 1)
263 timeout = 1;
264 else if (timeout == MAX_SCHEDULE_TIMEOUT)
265 timeout = 0;
270 if (atomic_read(&task->state) != TASK_WAKING) {
271 ret = linux_add_to_sleepqueue(task, task, "wevent", timeout,
284 linux_schedule_timeout(int timeout)
293 /* range check timeout */
294 if (timeout < 1)
295 timeout = 1;
296 else if (timeout == MAX_SCHEDULE_TIMEOUT)
297 timeout = 0;
299 remainder = ticks + timeout;
302 state = atomic_read(&task->state);
304 ret = linux_add_to_sleepqueue(task, task, "sched", timeout,
312 if (timeout == 0)
316 remainder -= ticks;
319 if (ret == -ERESTARTSYS && remainder < 1)
323 else if (remainder > timeout)
324 remainder = timeout;
347 int timeout)
353 /* range check timeout */
354 if (timeout < 1)
355 timeout = 1;
356 else if (timeout == MAX_SCHEDULE_TIMEOUT)
357 timeout = 0;
369 ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout,