mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Don't forget to release a thread reference count,
replace _thr_ref_add() with _thr_find_thread(), so reference count is no longer needed. MFC after: 3 days
This commit is contained in:
parent
42420dccd5
commit
12dbbf86f8
1 changed files with 2 additions and 4 deletions
|
|
@ -70,9 +70,8 @@ _pthread_setschedparam(pthread_t pthread, int policy,
|
|||
curthread->attr.prio = param->sched_priority;
|
||||
}
|
||||
THR_UNLOCK(curthread);
|
||||
} else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0))
|
||||
== 0) {
|
||||
THR_THREAD_LOCK(curthread, pthread);
|
||||
} else if ((ret = _thr_find_thread(curthread, pthread,
|
||||
/*include dead*/0)) == 0) {
|
||||
if (pthread->attr.sched_policy == policy &&
|
||||
(policy == SCHED_OTHER ||
|
||||
pthread->attr.prio == param->sched_priority)) {
|
||||
|
|
@ -88,7 +87,6 @@ _pthread_setschedparam(pthread_t pthread, int policy,
|
|||
pthread->attr.prio = param->sched_priority;
|
||||
}
|
||||
THR_THREAD_UNLOCK(curthread, pthread);
|
||||
_thr_ref_delete(curthread, pthread);
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue