*参照元 [#o1ae00cc]
#backlinks
*説明 [#jdc0bbed]
-パス: [[linux-2.6.33/kernel/workqueue.c]]
-FIXME: これは何?
--説明
**引数 [#fe306a5d]
-struct cpu_workqueue_struct *cwq
--
--[[linux-2.6.33/cpu_workqueue_struct]]
-int cpu
--
**返り値 [#e027f9d3]
-int
--成功した場合は 0、失敗した場合は 0 以外。
**参考 [#y624c64a]
*実装 [#g5a06202]
static int create_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
{
struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
struct workqueue_struct *wq = cwq->wq;
const char *fmt = is_wq_single_threaded(wq) ? "%s" : "%s/%d";
struct task_struct *p;
-
--[[linux-2.6.33/MAX_RT_PRIO]]
-
--[[linux-2.6.33/sched_param]]
-
--[[linux-2.6.33/workqueue_struct]]
-
--[[linux-2.6.33/is_wq_single_threaded()]]
-
--[[linux-2.6.33/task_struct]]
p = kthread_create(worker_thread, cwq, fmt, wq->name, cpu);
-
--[[linux-2.6.33/worker_thread()]]
-
--[[linux-2.6.33/kthread_create()]]
/*
* Nobody can add the work_struct to this cwq,
* if (caller is __create_workqueue)
* nobody should see this wq
* else // caller is CPU_UP_PREPARE
* cpu is not on cpu_online_map
* so we can abort safely.
*/
if (IS_ERR(p))
return PTR_ERR(p);
-
--[[linux-2.6.33/IS_ERR()]]
-
--[[linux-2.6.33/PTR_ERR()]]
if (cwq->wq->rt)
sched_setscheduler_nocheck(p, SCHED_FIFO, ¶m);
cwq->thread = p;
-
--[[linux-2.6.33/SCHED_FIFO]]
-
--[[linux-2.6.33/sched_setscheduler_nocheck()]]
trace_workqueue_creation(cwq->thread, cpu);
-
--[[linux-2.6.33/trace_workqueue_creation()]]
return 0;
}
*コメント [#r5e69c60]