|
11 | 11 | * Copyright (c) 2004-2005 The Regents of the University of California.
|
12 | 12 | * All rights reserved.
|
13 | 13 | * Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
|
14 |
| - * Copyright (c) 2015 Research Organization for Information Science |
| 14 | + * Copyright (c) 2015-2017 Research Organization for Information Science |
15 | 15 | * and Technology (RIST). All rights reserved.
|
16 | 16 | * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
|
17 | 17 | * reserved.
|
@@ -50,27 +50,27 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
|
50 | 50 |
|
51 | 51 | OPAL_CR_NOOP_PROGRESS();
|
52 | 52 |
|
53 |
| - /* Error checking */ |
| 53 | + /* Error checking */ |
54 | 54 |
|
55 |
| - if (MPI_PARAM_CHECK) { |
56 |
| - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); |
57 |
| - if (ompi_comm_invalid(comm)) { |
58 |
| - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, |
59 |
| - FUNC_NAME); |
60 |
| - } else if (NULL == errhandler) { |
61 |
| - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, |
62 |
| - FUNC_NAME); |
| 55 | + if (MPI_PARAM_CHECK) { |
| 56 | + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); |
| 57 | + if (ompi_comm_invalid(comm)) { |
| 58 | + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, |
| 59 | + FUNC_NAME); |
| 60 | + } else if (NULL == errhandler) { |
| 61 | + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, |
| 62 | + FUNC_NAME); |
| 63 | + } |
63 | 64 | }
|
64 |
| - } |
65 | 65 |
|
66 |
| - opal_mutex_lock (&comm->c_lock); |
67 |
| - /* Retain the errhandler, corresponding to object refcount decrease |
68 |
| - in errhandler_free.c. */ |
69 |
| - OBJ_RETAIN(comm->error_handler); |
70 |
| - *errhandler = comm->error_handler; |
71 |
| - opal_mutex_unlock (&comm->c_lock); |
| 66 | + OPAL_THREAD_LOCK(&(comm->c_lock)); |
| 67 | + /* Retain the errhandler, corresponding to object refcount decrease |
| 68 | + in errhandler_free.c. */ |
| 69 | + OBJ_RETAIN(comm->error_handler); |
| 70 | + *errhandler = comm->error_handler; |
| 71 | + OPAL_THREAD_UNLOCK(&(comm->c_lock)); |
72 | 72 |
|
73 |
| - /* All done */ |
| 73 | + /* All done */ |
74 | 74 |
|
75 |
| - return MPI_SUCCESS; |
| 75 | + return MPI_SUCCESS; |
76 | 76 | }
|
0 commit comments