lkml.org 
[lkml]   [2004]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: waiting on a condition
On Thu, 14 Oct 2004, Davide Rossetti wrote:

> Martijn Sipkema wrote:
>
> >On Wed, 2004-10-13 at 17:30, Peter W. Morreale wrote:
> >
> >
> >>Have you looked at the wait_event() family yet? Adapting that
> >>methodolgy might
> >>suit your needs.
> >>
> >>
> >
> >wait_event() seems to be what I was looking for; I don't really like the
> >condition being an argument.
> >
> >
> >
> you may have a look at http://lwn.net/Articles/22913/
> it's interesting :)
> regards


You could always do:

while(whatever)
{
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(0);
if(signal_pending(current))
break; // Or do something else
}
set_current_state(TASK_RUNNING); // Probably redundant

You could also set a specific HZ for the timeout, and count
them for a "never happened" timeout.




Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
Note 96.31% of all statistics are fiction.

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.036 / U:2.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site