diff --git a/src/api/step_launch.c b/src/api/step_launch.c index 9ea00a44127500ab6db3a64ad7eeac48c32ff662..ea2e5f1ec6e07a87feb9a768b397cbc24766d44b 100644 --- a/src/api/step_launch.c +++ b/src/api/step_launch.c @@ -646,7 +646,7 @@ static int _msg_thr_create(struct step_launch_state *sls, int num_nodes) } slurm_attr_init(&attr); - if (pthread_create(&sls->msg_thread, NULL, + if (pthread_create(&sls->msg_thread, &attr, _msg_thr_internal, (void *)sls) != 0) { error("pthread_create of message thread: %m"); diff --git a/src/sattach/sattach.c b/src/sattach/sattach.c index 929dab253068e461ec332312edc97e8824d97b2e..988d5970413225dede89d6d68bb365435349dc96 100644 --- a/src/sattach/sattach.c +++ b/src/sattach/sattach.c @@ -365,6 +365,7 @@ static message_thread_state_t *_msg_thr_create(int num_nodes, int num_tasks) eio_obj_t *obj; int i; message_thread_state_t *mts; + pthread_attr_t attr; debug("Entering _msg_thr_create()"); mts = (message_thread_state_t *)xmalloc(sizeof(message_thread_state_t)); @@ -386,11 +387,14 @@ static message_thread_state_t *_msg_thr_create(int num_nodes, int num_tasks) eio_new_initial_obj(mts->msg_handle, obj); } - if (pthread_create(&mts->msg_thread, NULL, + slurm_attr_init(&attr); + if (pthread_create(&mts->msg_thread, &attr, _msg_thr_internal, (void *)mts) != 0) { error("pthread_create of message thread: %m"); + slurm_attr_destroy(&attr); goto fail; } + slurm_attr_destroy(&attr); return mts; fail: diff --git a/src/slurmd/slurmstepd/step_terminate_monitor.c b/src/slurmd/slurmstepd/step_terminate_monitor.c index 0636c1ac82bfc04f36fe6d7750c1ca6134dba987..3438374f82389da12397cf924de2317c7ab71dd6 100644 --- a/src/slurmd/slurmstepd/step_terminate_monitor.c +++ b/src/slurmd/slurmstepd/step_terminate_monitor.c @@ -56,6 +56,7 @@ static int call_external_program(void); void step_terminate_monitor_start(uint32_t jobid, uint32_t stepid) { slurm_ctl_conf_t *conf; + pthread_attr_t attr; pthread_mutex_lock(&lock); @@ -75,7 +76,9 @@ void step_terminate_monitor_start(uint32_t jobid, uint32_t stepid) program_name = xstrdup(conf->unkillable_program); slurm_conf_unlock(); - pthread_create(&tid, NULL, monitor, NULL); + slurm_attr_init(&attr); + pthread_create(&tid, &attr, monitor, NULL); + slurm_attr_destroy(&attr); running_flag = 1; recorded_jobid = jobid; recorded_stepid = stepid;