Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2012 03:22:17 +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: r238642 - head/lib/libthr/thread
Message-ID:  <201207200322.q6K3MHMQ051114@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidxu
Date: Fri Jul 20 03:22:17 2012
New Revision: 238642
URL: http://svn.freebsd.org/changeset/base/238642

Log:
  Don't assign same value.

Modified:
  head/lib/libthr/thread/thr_setprio.c
  head/lib/libthr/thread/thr_setschedparam.c

Modified: head/lib/libthr/thread/thr_setprio.c
==============================================================================
--- head/lib/libthr/thread/thr_setprio.c	Fri Jul 20 03:16:52 2012	(r238641)
+++ head/lib/libthr/thread/thr_setprio.c	Fri Jul 20 03:22:17 2012	(r238642)
@@ -45,10 +45,9 @@ _pthread_setprio(pthread_t pthread, int 
 	int	ret;
 
 	param.sched_priority = prio;
-	if (pthread == curthread) {
-		pthread = curthread;
+	if (pthread == curthread)
 		THR_LOCK(curthread);
-	} else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)))
+	else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)))
 		return (ret);
 	if (pthread->attr.sched_policy == SCHED_OTHER ||
 	    pthread->attr.prio == prio) {

Modified: head/lib/libthr/thread/thr_setschedparam.c
==============================================================================
--- head/lib/libthr/thread/thr_setschedparam.c	Fri Jul 20 03:16:52 2012	(r238641)
+++ head/lib/libthr/thread/thr_setschedparam.c	Fri Jul 20 03:22:17 2012	(r238642)
@@ -53,10 +53,9 @@ _pthread_setschedparam(pthread_t pthread
 	struct pthread	*curthread = _get_curthread();
 	int	ret;
 
-	if (pthread == curthread) {
-		pthread = curthread;
+	if (pthread == curthread)
 		THR_LOCK(curthread);
-	} else if ((ret = _thr_find_thread(curthread, pthread,
+	else if ((ret = _thr_find_thread(curthread, pthread,
 		 /*include dead*/0)) != 0)
 		return (ret);
 	if (pthread->attr.sched_policy == policy &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207200322.q6K3MHMQ051114>