Skip to contentSkip to conversation

(interruptible_)sleep_on_timeout question

DISCUSSION Xiaogeng (Shawn) Jin 1 participant 1 message May 24, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

Is it possible to dynamically change the timeout value of sleep_on_timeout()? I encountered a situation where the timeout value is got from some interrupt handler, which will modify the value. For example,

main() {
/* the main process goes to sleep with a timeout */
....
interruptible_sleep_on_timeout(q, timeout);
....
}

int_handler() {
/* If the interrupt happens before timeout, the handler
* gets a new timeout value and makes the main process
* continue to sleep.
*/
}

Is it possible to implement this mechanism? I thought about kernel timer and variation of sleep_on_timeout(). But all seems to have some problems.

Thanks a lot.

Shawn.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/