1
1

Merge pull request #4352 from edgargabriel/pr/sem_close_fix

sharedfp/sm: close the named semaphore
Этот коммит содержится в:
Gilles Gouaillardet 2017-10-19 17:04:43 +09:00 коммит произвёл GitHub
родитель 3ef23f41a3 4d995bd4eb
Коммит 9771c575f5

Просмотреть файл

@ -231,6 +231,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;
}
@ -263,7 +269,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);