@ -263,36 +263,6 @@ static void *thread_detach_func(void *d) {
return NULL ;
}
static int thread_create ( void * ( * func ) ( void * ) , void * arg , int joinable , pthread_t * handle , const char * name ) {
pthread_attr_t att ;
pthread_t thr ;
int ret ;
if ( pthread_attr_init ( & att ) )
abort ( ) ;
if ( pthread_attr_setdetachstate ( & att , joinable ? PTHREAD_CREATE_JOINABLE : PTHREAD_CREATE_DETACHED ) )
abort ( ) ;
if ( rtpe_config . common . thread_stack > 0 ) {
if ( pthread_attr_setstacksize ( & att , rtpe_config . common . thread_stack * 1024 ) ) {
ilog ( LOG_ERR , " Failed to set thread stack size to %llu " ,
( unsigned long long ) rtpe_config . common . thread_stack * 1024 ) ;
abort ( ) ;
}
}
ret = pthread_create ( & thr , & att , func , arg ) ;
pthread_attr_destroy ( & att ) ;
if ( ret )
return ret ;
if ( handle )
* handle = thr ;
# ifdef __GLIBC__
if ( name )
pthread_setname_np ( thr , name ) ;
# endif
return 0 ;
}
void thread_create_detach_prio ( void ( * f ) ( void * ) , void * d , const char * scheduler , int priority ,
const char * name )
{
@ -304,7 +274,7 @@ void thread_create_detach_prio(void (*f)(void *), void *d, const char *scheduler
dt - > scheduler = scheduler ;
dt - > priority = priority ;
if ( thread_create ( thread_detach_func , dt , 1 , NULL , name ) )
if ( thread_create ( thread_detach_func , dt , true , NULL , name ) )
abort ( ) ;
}