From b8e77ba759a6c620a32025ae0524a12d61eaeaca Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Fri, 1 Dec 2017 15:56:40 +0900 Subject: [PATCH] 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 --- ompi/mpi/c/file_get_errhandler.c | 4 ++-- ompi/mpi/c/file_set_errhandler.c | 4 ++-- ompi/mpi/c/win_get_errhandler.c | 6 +++--- ompi/mpi/c/win_set_errhandler.c | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ompi/mpi/c/file_get_errhandler.c b/ompi/mpi/c/file_get_errhandler.c index cab8824661..e0abadd4a5 100644 --- a/ompi/mpi/c/file_get_errhandler.c +++ b/ompi/mpi/c/file_get_errhandler.c @@ -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 */ diff --git a/ompi/mpi/c/file_set_errhandler.c b/ompi/mpi/c/file_set_errhandler.c index ebb0d2be61..20b9c824a8 100644 --- a/ompi/mpi/c/file_set_errhandler.c +++ b/ompi/mpi/c/file_set_errhandler.c @@ -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; diff --git a/ompi/mpi/c/win_get_errhandler.c b/ompi/mpi/c/win_get_errhandler.c index 23a1c6f50f..5704950ebf 100644 --- a/ompi/mpi/c/win_get_errhandler.c +++ b/ompi/mpi/c/win_get_errhandler.c @@ -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; diff --git a/ompi/mpi/c/win_set_errhandler.c b/ompi/mpi/c/win_set_errhandler.c index b630cad3d5..e1e6f3e059 100644 --- a/ompi/mpi/c/win_set_errhandler.c +++ b/ompi/mpi/c/win_set_errhandler.c @@ -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;