mpi/c: use OPAL_THREAD[UN]LOCK() instead of opal_mutex_[un]lock()
in order to keep consistency between ompi_communicator_t, ompi_file_t and ompi_win_t. Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
родитель
1ba4c185bc
Коммит
b8e77ba759
@ -62,12 +62,12 @@ int MPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler)
|
||||
}
|
||||
}
|
||||
|
||||
opal_mutex_lock (&file->f_lock);
|
||||
OPAL_THREAD_LOCK(&file->f_lock);
|
||||
/* Retain the errhandler, corresponding to object refcount
|
||||
decrease in errhandler_free.c. */
|
||||
*errhandler = file->error_handler;
|
||||
OBJ_RETAIN(file->error_handler);
|
||||
opal_mutex_unlock (&file->f_lock);
|
||||
OPAL_THREAD_UNLOCK(&file->f_lock);
|
||||
|
||||
/* All done */
|
||||
|
||||
|
@ -68,12 +68,12 @@ int MPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler)
|
||||
/* Prepare the new error handler */
|
||||
OBJ_RETAIN(errhandler);
|
||||
|
||||
opal_mutex_lock (&file->f_lock);
|
||||
OPAL_THREAD_LOCK(&file->f_lock);
|
||||
/* Ditch the old errhandler, and decrement its refcount. */
|
||||
tmp = file->error_handler;
|
||||
file->error_handler = errhandler;
|
||||
OBJ_RELEASE(tmp);
|
||||
opal_mutex_unlock (&file->f_lock);
|
||||
OPAL_THREAD_UNLOCK(&file->f_lock);
|
||||
|
||||
/* All done */
|
||||
return MPI_SUCCESS;
|
||||
|
@ -11,7 +11,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
@ -55,12 +55,12 @@ int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
|
||||
}
|
||||
}
|
||||
|
||||
opal_mutex_lock (&win->w_lock);
|
||||
OPAL_THREAD_LOCK(&win->w_lock);
|
||||
/* Retain the errhandler, corresponding to object refcount
|
||||
decrease in errhandler_free.c. */
|
||||
OBJ_RETAIN(win->error_handler);
|
||||
*errhandler = win->error_handler;
|
||||
opal_mutex_unlock (&win->w_lock);
|
||||
OPAL_THREAD_UNLOCK(&win->w_lock);
|
||||
|
||||
/* All done */
|
||||
return MPI_SUCCESS;
|
||||
|
@ -11,7 +11,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
@ -63,12 +63,12 @@ int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler)
|
||||
/* Prepare the new error handler */
|
||||
OBJ_RETAIN(errhandler);
|
||||
|
||||
opal_mutex_lock (&win->w_lock);
|
||||
OPAL_THREAD_LOCK(&win->w_lock);
|
||||
/* Ditch the old errhandler, and decrement its refcount. */
|
||||
tmp = win->error_handler;
|
||||
win->error_handler = errhandler;
|
||||
OBJ_RELEASE(tmp);
|
||||
opal_mutex_unlock (&win->w_lock);
|
||||
OPAL_THREAD_UNLOCK(&win->w_lock);
|
||||
|
||||
/* All done */
|
||||
return MPI_SUCCESS;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user