realtime: rearrange the pthread attr functions order in librttest
PATCH 1/1 realtime: rearrange the pthread attr functions order in librttest
From: gowrishankar <[email protected]>
In the recent pthread libraries, order of calling pthread_attr_setschedpolicy and pthread_attr_setschedparam plays important role in a way that, former should always be called followed by later.
Otherwise, pthread_attr_setschedparam always ends with error 22 (EINVAL). This patch fixes the create_thread() in librttest library.
--- testcases/realtime/lib/librttest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/realtime/lib/librttest.c +1 -1
@@ -295,8 +295,8 @@ int create_thread(void*(*func)(void*), void *arg, int prio, int policy)pthread_attr_init (&thread->attr);pthread_attr_setinheritsched (&thread->attr,PTHREAD_EXPLICIT_SCHED ); -pthread_attr_setschedparam (&thread->attr, ¶m);pthread_attr_setschedpolicy (&thread->attr, thread->policy); +pthread_attr_setschedparam (&thread->attr, ¶m);if ((ret =pthread_create (&thread->pthread, &thread->attr, func, (void *)thread))) {printf ("pthread_create failed: %d (%s)\n" , ret,strerror (ret));
Signature · 11 lines
1.7.1 ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 10 lines · Gowrishankar
From: gowrishankar <[email protected]>
In the recent pthread libraries, order of calling
pthread_attr_setschedpolicyandpthread_attr_setschedparamplays important role in a way that, former should always be called followed by later.Otherwise,
pthread_attr_setschedparamalways ends with error 22 (EINVAL). This patch fixes thecreate_thread()in librttest library.Signed-off-by Gowrishankar <[email protected]>
Thanks.
Regards--
Subrata
Quoted 12 lines
Tested-by Gowrishankar <[email protected]>Acked-by Will Schmidt <[email protected]>Acked-by Darren Hart <[email protected]>--- testcases/realtime/lib/librttest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)testcases/realtime/lib/librttest.c +0
-0
testcases/realtime/lib/librttest.c int create_thread(void*(*func)(void*), void *arg, int prio, int policy) · line 302
Quoted 9 lines
testcases/realtime/lib/librttest.c +1
-1@@ -295,8 +295,8 @@ int create_thread(void*(*func)(void*), void *arg, int prio, int policy)pthread_attr_init (&thread->attr);pthread_attr_setinheritsched (&thread->attr,PTHREAD_EXPLICIT_SCHED ); -pthread_attr_setschedparam (&thread->attr, ¶m);pthread_attr_setschedpolicy (&thread->attr, thread->policy); +pthread_attr_setschedparam (&thread->attr, ¶m);if ((ret =pthread_create (&thread->pthread, &thread->attr, func, (void *)thread))) {printf ("pthread_create failed: %d (%s)\n" , ret,strerror (ret));
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list