summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadsetaffinitynp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-03 15:03:35 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-04 11:01:18 +0200
commit24934e36e2513f972510d7c746103be1f766dc6a (patch)
tree66e3c8840cec6c1262f142e25ec545926140dbf9 /cpukit/posix/src/pthreadsetaffinitynp.c
parentscore: Add and use Scheduler_simple_Control (diff)
downloadrtems-24934e36e2513f972510d7c746103be1f766dc6a.tar.bz2
score: Add scheduler control to scheduler ops
Scheduler operations must be free of a global scheduler context to enable partitioned/clustered scheduling.
Diffstat (limited to 'cpukit/posix/src/pthreadsetaffinitynp.c')
-rw-r--r--cpukit/posix/src/pthreadsetaffinitynp.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/cpukit/posix/src/pthreadsetaffinitynp.c b/cpukit/posix/src/pthreadsetaffinitynp.c
index d150b409a1..d9df75b8de 100644
--- a/cpukit/posix/src/pthreadsetaffinitynp.c
+++ b/cpukit/posix/src/pthreadsetaffinitynp.c
@@ -47,15 +47,18 @@ int pthread_setaffinity_np(
switch ( location ) {
case OBJECTS_LOCAL:
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
- ok = _Scheduler_Set_affinity( the_thread, cpusetsize, cpuset );
- if (ok)
+ ok = _Scheduler_Set_affinity(
+ _Scheduler_Get( the_thread ),
+ the_thread,
+ cpusetsize,
+ cpuset
+ );
+ if ( ok ) {
+ api = the_thread->API_Extensions[ THREAD_API_POSIX ];
CPU_COPY( api->Attributes.affinityset, cpuset );
+ }
_Objects_Put( &the_thread->Object );
- if (!ok)
- return EINVAL;
- return 0;
- break;
+ return ok ? 0 : EINVAL;
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: