diff options
Diffstat (limited to 'cpukit/posix/src/pthreadsetaffinitynp.c')
-rw-r--r-- | cpukit/posix/src/pthreadsetaffinitynp.c | 17 |
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: |