Re: linux sleep implementation



Iwo Mergler wrote:

I vaguely remember the above code to be a workaround to avoid a race
condition when using a 2.4.x kernel. Newer kernels have a call which
allows you to go to sleep and check your condition atomically.

Well, from linux/wait.h :

void wait_event(wait_queue_head_t waitqueue, condition);

and

int wait_event_interruptible (wait_queue_head_t wait_queue, condition);

that's the state of the art...



hth

Marco
.



Relevant Pages