diff options
author | Richard Braun <rbraun@sceen.net> | 2014-04-26 15:08:32 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-04-26 15:08:32 +0200 |
commit | 6fdc04fb087b2ec156cc0ea4d024f555a3cf0de4 (patch) | |
tree | c5b198364cbc4df29c30c2d1d3fa05ec51ff0122 /kern/work.c | |
parent | 1c381122ca240a496bddf3d2ad5c52693e221184 (diff) |
kern/work: use thread creation attributes accessors
Diffstat (limited to 'kern/work.c')
-rw-r--r-- | kern/work.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/kern/work.c b/kern/work.c index 2a08cee0..d137f72b 100644 --- a/kern/work.c +++ b/kern/work.c @@ -242,6 +242,7 @@ work_thread_create(struct work_pool *pool) char name[THREAD_NAME_SIZE]; struct thread_attr attr; struct work_thread *worker; + unsigned short priority; int error; worker = kmem_cache_alloc(&work_thread_cache); @@ -258,13 +259,11 @@ work_thread_create(struct work_pool *pool) snprintf(name, sizeof(name), "x15_work_process:%s:%llu", pool->name, worker->id); - attr.name = name; - attr.cpumap = NULL; - attr.task = NULL; - attr.policy = THREAD_SCHED_POLICY_TS; - attr.priority = (pool->flags & WORK_PF_HIGHPRIO) - ? WORK_PRIO_HIGH - : WORK_PRIO_NORMAL; + priority = (pool->flags & WORK_PF_HIGHPRIO) + ? WORK_PRIO_HIGH + : WORK_PRIO_NORMAL; + thread_attr_init(&attr, name); + thread_attr_set_priority(&attr, priority); error = thread_create(&worker->thread, &attr, work_process, worker); if (error) |