I wonder how can I use wake_up_interruptible, if it returns void: http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/wait.h#L161 (_wake_up function returns void). For example, down_interruptible function returns int: http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/kernel/semaphore.c#L75 This allows to write such code, for example:
if ( down_interruptible(&dev->sem) )
return -ERESTARTSYS;
// continue: down_interruptible succeeded
When I call wake_up_interruptible, and it is interrupted, how can I know this, if it returns void?
i suppose normal usage scenario would be, in one thread:
for (;;) { wait_event_interruptible(wait_queue, condition); /* Some processing */ }and from some other thread:
which will result in one process from
wait_queuewhich is inTASK_INTERRUPTIBLEstate to be woken up and evalueateconditionsee some more examples here, a bit dated bit gives an idea