Messages in this thread | | | Date | Mon, 16 Aug 2004 04:22:28 +0200 | From | Ingo Molnar <> | Subject | Re: Add msleep_interruptible() function to kernel/timer.c |
| |
* maximilian attems <janitor@sternwelten.at> wrote:
> +/** > + * msleep_interruptible - sleep waiting for waitqueue interruptions > + * @msecs: Time in milliseconds to sleep for > + */ > +unsigned int msleep_interruptible(unsigned int msecs) > +{ > + unsigned long timeout = msecs_to_jiffies(msecs); > + > + while (timeout && !signal_pending(current)) { > + set_current_state(TASK_INTERRUPTIBLE); > + timeout = schedule_timeout(timeout); > + } > + return jiffies_to_msecs(timeout); > +}
looks good to me.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |