[patch] Re: cvs commit: src/lib/libthread_xu/thread thr_attr.c thr_getschedparam.c thr_kern.c thr_private.h thr_setschedparam.c

Aggelos Economopoulos aoiko at cc.ece.ntua.gr
Fri May 4 02:25:04 PDT 2007


On Friday 04 May 2007 02:08, Matthew Dillon wrote:

>   1.6       +35 -37    src/lib/libthread_xu/thread/thr_setschedparam.c

Can anyone spot the copy-paste error in this file? Hint attached :)

(unfortunately the code below was correct so userland still kept track of the 
prio values (so that my test prog didn't notice anything) but it changed the 
kernel priority for the current thread only)

Aggelos
Index: thread/thr_setschedparam.c
===================================================================
RCS file: /home/aggelos/imports/vcs/dcvs/src/lib/libthread_xu/thread/thr_setschedparam.c,v
retrieving revision 1.6
diff -u -u -r1.6 thr_setschedparam.c
--- thread/thr_setschedparam.c	3 May 2007 23:08:34 -0000	1.6
+++ thread/thr_setschedparam.c	4 May 2007 09:11:09 -0000
@@ -78,10 +78,10 @@
 			return (0);
 		}
 		if (policy == SCHED_OTHER) {
-			ret = _thr_set_sched_other_prio(curthread,
+			ret = _thr_set_sched_other_prio(pthread,
 						param->sched_priority);
 		} else {
-			ret = _thr_setscheduler(curthread->tid, policy, param);
+			ret = _thr_setscheduler(pthread->tid, policy, param);
 		}
 		if (ret == -1)
 			ret = errno;




More information about the Commits mailing list