Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Chapter03/shared-workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ static void work_handler(struct work_struct *work)
struct work_data, my_work);
pr_info("Work queue module handler: %s, data is %d\n", __FUNCTION__, my_data->the_data);
msleep(3000);
sleep = 1;
wake_up_interruptible(&my_data->my_wq);
kfree(my_data);
}

static int __init my_init(void)
Expand All @@ -40,6 +40,7 @@ static int __init my_init(void)
pr_info("I'm goint to sleep ...\n");
wait_event_interruptible(my_data->my_wq, sleep != 0);
pr_info("I am Waked up...\n");
kfree(my_data);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion Chapter03/user-invoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void delayed_shutdown(struct work_struct *work)
NULL,
};

call_usermodehelper(cmd, argv, envp, 0);
call_usermodehelper(cmd, argv, envp, UMH_WAIT_PROC);
}

static int __init my_shutdown_init( void )
Expand Down