summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthread.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-10 07:13:37 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-10 07:17:51 +0200
commit4f9ed26655c2659fcf697a281cb401aa919849bf (patch)
treeb73d6b1fae44a8101e0c46f88a8729c074d6d5f4 /cpukit/posix/src/pthread.c
parentposix: Simplify pthread_attr_setstack() (diff)
downloadrtems-4f9ed26655c2659fcf697a281cb401aa919849bf.tar.bz2
posix: Constify default thread processor affinity
Set default thread processor affinity to all processors of the pre-allocated set. This allows to constify the _POSIX_Threads_Default_attributes. Update #2514.
Diffstat (limited to 'cpukit/posix/src/pthread.c')
-rw-r--r--cpukit/posix/src/pthread.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 1d791df7eb..171d0366df 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -49,7 +49,7 @@ Thread_Information _POSIX_Threads_Information;
* NOTE: Be careful .. if the default attribute set changes,
* _POSIX_Threads_Initialize_user_threads will need to be examined.
*/
-pthread_attr_t _POSIX_Threads_Default_attributes = {
+const pthread_attr_t _POSIX_Threads_Default_attributes = {
.is_initialized = true, /* is_initialized */
.stackaddr = NULL, /* stackaddr */
.stacksize = 0, /* stacksize -- will be adjusted to minimum */
@@ -79,7 +79,7 @@ pthread_attr_t _POSIX_Threads_Default_attributes = {
sizeof( _POSIX_Threads_Default_attributes.affinitysetpreallocated ),
.affinityset =
&_POSIX_Threads_Default_attributes.affinitysetpreallocated,
- .affinitysetpreallocated = {{0x1}}
+ .affinitysetpreallocated = { { -1L } }
};
void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
@@ -243,21 +243,6 @@ User_extensions_Control _POSIX_Threads_User_extensions = {
*/
static void _POSIX_Threads_Manager_initialization(void)
{
- #if defined(RTEMS_SMP)
- const CPU_set_Control *affinity;
- pthread_attr_t *attr;
-
- /* Initialize default attribute. */
- attr = &_POSIX_Threads_Default_attributes;
-
- /* Initialize the affinity to be the default cpu set for the system */
- affinity = _CPU_set_Default();
- _Assert( affinity->setsize == sizeof( attr->affinitysetpreallocated ) );
- attr->affinityset = &attr->affinitysetpreallocated;
- attr->affinitysetsize = affinity->setsize;
- CPU_COPY( affinity->set, attr->affinityset );
- #endif
-
_Thread_Initialize_information(
&_POSIX_Threads_Information, /* object information table */
OBJECTS_POSIX_API, /* object API */