diff options
| author | Michael Hunold <devnull@localhost> | 2004-01-31 11:31:34 +0000 |
|---|---|---|
| committer | Michael Hunold <devnull@localhost> | 2004-01-31 11:31:34 +0000 |
| commit | addda418ec6c46e0d9f16fa51d70ff19e6b63ec0 (patch) | |
| tree | 6ca8efaec609c2674ff7ba9ff654ca0634d7bcf3 /linux/drivers/media/dvb/dvb-core | |
| parent | 3e3a2ec29fa5dea15eed40cd7a67c8264f4ac614 (diff) | |
| download | mediapointer-dvb-s2-addda418ec6c46e0d9f16fa51d70ff19e6b63ec0.tar.gz mediapointer-dvb-s2-addda418ec6c46e0d9f16fa51d70ff19e6b63ec0.tar.bz2 | |
- add wait_event_interruptible_timeout() macro to dvb-compat.h
- replace usage of sleep_on_interruptible_timeout() with
wait_event_interruptible_timeout()
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core')
| -rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_compat.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_compat.h b/linux/drivers/media/dvb/dvb-core/dvb_compat.h index 5f25ec5b3..a390dfcea 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_compat.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_compat.h @@ -8,6 +8,39 @@ #include <linux/fs.h> #include <linux/devfs_fs_kernel.h> +#ifndef wait_event_interruptible_timeout +#define __wait_event_interruptible_timeout(wq, condition, ret) \ +do { \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ + \ + add_wait_queue(&wq, &__wait); \ + for (;;) { \ + set_current_state(TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + current->state = TASK_RUNNING; \ + remove_wait_queue(&wq, &__wait); \ +} while (0) + +#define wait_event_interruptible_timeout(wq, condition, timeout) \ +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_interruptible_timeout(wq, condition, __ret); \ + __ret; \ +}) +#endif + #ifndef VIDEO_AUDIO_BALANCE #define VIDEO_AUDIO_BALANCE 32 #endif |
