Date: Fri, 20 Jul 2012 01:56:14 +0000 (UTC) From: David Xu <davidxu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r238637 - head/lib/libthr/thread Message-ID: <201207200156.q6K1uEfB044197@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davidxu Date: Fri Jul 20 01:56:14 2012 New Revision: 238637 URL: http://svn.freebsd.org/changeset/base/238637 Log: 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 Modified: head/lib/libthr/thread/thr_setschedparam.c Modified: head/lib/libthr/thread/thr_setschedparam.c ============================================================================== --- head/lib/libthr/thread/thr_setschedparam.c Fri Jul 20 01:41:18 2012 (r238636) +++ head/lib/libthr/thread/thr_setschedparam.c Fri Jul 20 01:56:14 2012 (r238637) @@ -70,9 +70,8 @@ _pthread_setschedparam(pthread_t pthread 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 pthread->attr.prio = param->sched_priority; } THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); } return (ret); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207200156.q6K1uEfB044197>