summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadinitthreads.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2013-08-23 14:56:36 +1000
committerChris Johns <chrisj@rtems.org>2013-08-23 14:56:36 +1000
commit6e4c01e3a2c07d3d42c510fbff70c14ccbafd2df (patch)
treeec6d62205983fabb345a6d84cd50804265fe3349 /cpukit/posix/src/pthreadinitthreads.c
parentbsps/arm: Add more CP15 cache functions (diff)
downloadrtems-6e4c01e3a2c07d3d42c510fbff70c14ccbafd2df.tar.bz2
posix: Update to the pthread_once changes.
Implement the reeview changes. Add a POSIX Fatal error domain. Fix confdefs.h to correctly handle the internal POSIX mutexes.
Diffstat (limited to 'cpukit/posix/src/pthreadinitthreads.c')
-rw-r--r--cpukit/posix/src/pthreadinitthreads.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/cpukit/posix/src/pthreadinitthreads.c b/cpukit/posix/src/pthreadinitthreads.c
index 961105c669..1ec28ba6c3 100644
--- a/cpukit/posix/src/pthreadinitthreads.c
+++ b/cpukit/posix/src/pthreadinitthreads.c
@@ -29,6 +29,7 @@
#include <rtems/score/thread.h>
#include <rtems/score/wkspace.h>
#include <rtems/posix/cancel.h>
+#include <rtems/posix/posixapi.h>
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/config.h>
@@ -36,7 +37,7 @@
void _POSIX_Threads_Initialize_user_threads_body(void)
{
- int status;
+ int eno;
uint32_t index;
uint32_t maximum;
posix_initialization_threads_table *user_threads;
@@ -60,18 +61,20 @@ void _POSIX_Threads_Initialize_user_threads_body(void)
/*
* There is no way for these calls to fail in this situation.
*/
- (void) pthread_attr_init( &attr );
- (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
- (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
+ eno = pthread_attr_init( &attr );
+ _Assert( eno == 0 );
+ eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
+ _Assert( eno == 0 );
+ eno = pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
+ _Assert( eno == 0 );
- status = pthread_create(
+ eno = pthread_create(
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
- if ( status )
- _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
+ if ( eno )
+ _POSIX_Fatal_error( POSIX_FD_PTHREAD, eno );
}
}
-