wait.c (f1615bbe9be4def59c3b3eaddb60722efeed16c2) wait.c (743162013d40ca612b4cb53d3a200dff2d9ab26e)
1/*
2 * Generic waiting primitives.
3 *
4 * (C) 2004 Nadia Yvette Chambers, Oracle
5 */
6#include <linux/init.h>
7#include <linux/export.h>
8#include <linux/sched.h>

--- 488 unchanged lines hidden (view full) ---

497 * Abuse the bit-waker function and its waitqueue hash table set (the atomic_t
498 * check is done by the waiter's wake function, not the by the waker itself).
499 */
500void wake_up_atomic_t(atomic_t *p)
501{
502 __wake_up_bit(atomic_t_waitqueue(p), p, WAIT_ATOMIC_T_BIT_NR);
503}
504EXPORT_SYMBOL(wake_up_atomic_t);
1/*
2 * Generic waiting primitives.
3 *
4 * (C) 2004 Nadia Yvette Chambers, Oracle
5 */
6#include <linux/init.h>
7#include <linux/export.h>
8#include <linux/sched.h>

--- 488 unchanged lines hidden (view full) ---

497 * Abuse the bit-waker function and its waitqueue hash table set (the atomic_t
498 * check is done by the waiter's wake function, not the by the waker itself).
499 */
500void wake_up_atomic_t(atomic_t *p)
501{
502 __wake_up_bit(atomic_t_waitqueue(p), p, WAIT_ATOMIC_T_BIT_NR);
503}
504EXPORT_SYMBOL(wake_up_atomic_t);
505
506__sched int bit_wait(void *word)
507{
508 if (signal_pending_state(current->state, current))
509 return 1;
510 schedule();
511 return 0;
512}
513EXPORT_SYMBOL(bit_wait);
514
515__sched int bit_wait_io(void *word)
516{
517 if (signal_pending_state(current->state, current))
518 return 1;
519 io_schedule();
520 return 0;
521}
522EXPORT_SYMBOL(bit_wait_io);