Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions ompi/file/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ int ompi_file_open(struct ompi_communicator_t *comm, const char *filename,
return OMPI_ERR_OUT_OF_RESOURCE;
}

/* Create the mutex */
OBJ_CONSTRUCT(&file->f_lock, opal_mutex_t);

/* Select a module and actually open the file */

if (OMPI_SUCCESS != (ret = mca_io_base_file_select(file, NULL))) {
Expand All @@ -156,9 +153,6 @@ int ompi_file_open(struct ompi_communicator_t *comm, const char *filename,
*/
int ompi_file_close(ompi_file_t **file)
{

OBJ_DESTRUCT(&(*file)->f_lock);

(*file)->f_flags |= OMPI_FILE_ISCLOSED;
OBJ_RELEASE(*file);
*file = &ompi_mpi_file_null.file;
Expand Down Expand Up @@ -241,6 +235,7 @@ static void file_constructor(ompi_file_t *file)
file->f_comm = NULL;
file->f_filename = NULL;
file->f_amode = 0;
OBJ_CONSTRUCT(&file->f_lock, opal_mutex_t);

/* Initialize flags */

Expand Down Expand Up @@ -335,4 +330,6 @@ static void file_destructor(ompi_file_t *file)
opal_pointer_array_set_item(&ompi_file_f_to_c_table,
file->f_f_to_c_index, NULL);
}

OBJ_DESTRUCT(&(file->f_lock));
}