/**
* kthread_run - create and wake a thread.
* @threadfn: the function to run until signal_pending(current).线程函数
* @data: data ptr for @threadfn.参数
* @namefmt: printf-style name for the thread.创建的线程名称
*
* Description: Convenient wrapper for kthread_create() followed by
* wake_up_process(). Returns the kthread or ERR_PTR(-ENOMEM).
* 返回一个struct task_struct对象指针,用于操作线程
*/
#define kthread_run(threadfn, data, namefmt, ...) \
({ \
struct task_struct *__k \
= kthread_create(threadfn, data, namefmt, ## __VA_ARGS__); \
if (!IS_ERR(__k)) \
wake_up_process(__k); \
__k; \
})