linux等待队列wait_queue_head_t和wait_queue_t_bytxl的专栏-CSDN博客
DECLARE_WAITQUEUE(wait, current);
#define DECLARE_WAITQUEUE(name, tsk) \
struct wait_queue_entry name = __WAITQUEUE_INITIALIZER(name, tsk)
#define __WAITQUEUE_INITIALIZER(name, tsk) { \
.private = tsk, \
.func = default_wake_function, \
.entry = { NULL, NULL } }
struct wait_queue_entry {
unsigned int flags;
void *private;
wait_queue_func_t func;
struct list_head entry;
};
int default_wake_function(wait_queue_entry_t *curr, unsigned mode, int wake_flags,
void *key)
{
//wake up a thread
return try_to_wake_up(curr->private, mode, wake_flags, 1);
}