Skip to content

Commit

Permalink
Merge pull request #4685 from edgargabriel/pr/v2.x-sem-close-fix
Browse files Browse the repository at this point in the history
sharedfp/sm: close the named semaphore
  • Loading branch information
hppritcha authored Jan 12, 2018
2 parents eabf853 + 444e95b commit 5327dd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ompi/mca/sharedfp/sm/sharedfp_sm_file_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,

comm->c_coll.coll_barrier (comm, comm->c_coll.coll_barrier_module );

#if defined(HAVE_SEM_OPEN)
if ( 0 == rank ) {
sem_unlink ( sm_data->sem_name);
}
#endif

return err;
}

Expand Down Expand Up @@ -267,7 +273,7 @@ int mca_sharedfp_sm_file_close (mca_io_ompio_file_t *fh)
if (file_data->sm_offset_ptr) {
/* destroy semaphore */
#if defined(HAVE_SEM_OPEN)
sem_unlink (file_data->sem_name);
sem_close ( file_data->mutex);
free (file_data->sem_name);
#elif defined(HAVE_SEM_INIT)
sem_destroy(&file_data->sm_offset_ptr->mutex);
Expand Down

0 comments on commit 5327dd6

Please sign in to comment.