delay attempt 2

This commit is contained in:
Ciro Santilli
2017-05-15 08:18:51 +01:00
parent c82378c7de
commit 9370512176
4 changed files with 13 additions and 2 deletions

View File

@@ -7,8 +7,6 @@ Usage:
dmesg prints an integer every second until rmmod.
Since insmod returns, this Illustrates how the work queues are asynchronous.
TODO: insmod not returning...
*/
#include <linux/delay.h>
@@ -43,6 +41,9 @@ int init_module(void)
void cleanup_module(void)
{
/* This waits for the work to finish. From docstring: */
/* > Cancel @work and wait for its execution to finish. */
cancel_work_sync(&work);
destroy_workqueue(queue);
}