int my_fuction(void *arg) { printk("<1> in %s()\n", __FUNCTION__); daemonize("demo-thread"); allow_signal(SIGKILL); mdelay(2000); printk("<1> my_function complete()\n"); complete(&my_completion); // wake up wait_for_completion
while (!signal_pending(current)) { // no signal printk("<1> jiffies is %lu\n", jiffies); set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ * 5); }