summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-04-03 15:03:42 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-04-03 15:03:42 -0500
commit68c156aea71718a739706245b71d43b8358058ff (patch)
tree23d103290a5e60b12b26c16908b1461ec17abfa2
parentpthread.c: Conditionalize thread affinity initialization (diff)
downloadrtems-68c156aea71718a739706245b71d43b8358058ff.tar.bz2
pthreadcreate.c: Fix bug where attr used instead of the_attr
-rw-r--r--cpukit/posix/src/pthreadcreate.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index 8db6948830..8ae790480b 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -9,7 +9,8 @@
* 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144
*/
-/* COPYRIGHT (c) 1989-2008.
+/*
+ * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -142,7 +143,7 @@ int pthread_create(
#if defined(RTEMS_SMP)
#if __RTEMS_HAVE_SYS_CPUSET_H__
status = _CPU_set_Is_valid( the_attr->affinityset, the_attr->affinitysetsize );
- if (!status )
+ if ( !status )
return EINVAL;
#endif
#endif
@@ -191,19 +192,17 @@ int pthread_create(
return EAGAIN;
}
-#if defined(RTEMS_SMP)
-#if __RTEMS_HAVE_SYS_CPUSET_H__
- status = _Scheduler_Set_affinity(
- the_thread,
- attr->affinitysetsize,
- attr->affinityset
+#if defined(RTEMS_SMP) && __RTEMS_HAVE_SYS_CPUSET_H__
+ status = _Scheduler_Set_affinity(
+ the_thread,
+ the_attr->affinitysetsize,
+ the_attr->affinityset
);
- if ( !status ) {
- _POSIX_Threads_Free( the_thread );
- _RTEMS_Unlock_allocator();
- return EINVAL;
- }
-#endif
+ if ( !status ) {
+ _POSIX_Threads_Free( the_thread );
+ _RTEMS_Unlock_allocator();
+ return EINVAL;
+ }
#endif
/*