#include #include #include "aauug.h" DECLARE_COMPLETION(thread_terminated); DECLARE_MUTEX_LOCKED(thread_ready); task_t *our_thread=NULL; int aauug_thread(void *arg) { unsigned int cnt=0; daemonize("kaauugd"); our_thread=current; up(&thread_ready); while(!quit_flag) { snprintf(current->comm,15,"kaauugd %d",++cnt); schedule_timeout_interruptible(HZ*10); } down(&ready_to_quit); complete_and_exit(&thread_terminated,0); }