[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100226081418.5902446f.akpm@linux-foundation.org>
Date: Fri, 26 Feb 2010 08:14:18 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Rafał Miłecki <zajec5@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
DRI <dri-devel@...ts.sourceforge.net>
Subject: Re: [PATCH][RFC] time: add wait_interruptible_timeout macro to
sleep (w. timeout) until wake_up
On Fri, 26 Feb 2010 11:38:59 +0100 Rafa Miecki <zajec5@...il.com> wrote:
> +#define wait_interruptible_timeout(wq, timeout)
> \
> +({ \
> + long ret = timeout; \
> + \
> + DEFINE_WAIT(wait); \
> + prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE); \
> + if (!signal_pending(current)) \
> + ret = schedule_timeout(ret); \
> + finish_wait(&wq, &wait); \
> + \
> + ret; \
> +})
It's often a mistake to use signals in-kernel. Signals are more a
userspace thing and it's better to use the lower-level kernel-specific
messaging tools in-kernel. Bear in mind that userspace can
independently and asynchronously send, accept and block signals.
Can KMS use wait_event_interruptible_timeout()?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists