Make sure we do the right thing with refcounts on errhandler
This commit was SVN r989.
Этот коммит содержится в:
родитель
e51724a75f
Коммит
a37a5438c7
@ -29,13 +29,14 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function,
|
||||
}
|
||||
}
|
||||
|
||||
/* Create and cache the errhandler */
|
||||
/* Create and cache the errhandler. Sets a refcount of 1. */
|
||||
|
||||
*errhandler =
|
||||
lam_errhandler_create(LAM_ERRHANDLER_TYPE_COMM,
|
||||
(lam_errhandler_fortran_handler_fn_t*) function);
|
||||
if (NULL == *errhandler)
|
||||
if (NULL == *errhandler) {
|
||||
err = MPI_ERR_INTERN;
|
||||
}
|
||||
|
||||
LAM_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN,
|
||||
"MPI_Comm_create_errhandler");
|
||||
|
@ -29,7 +29,8 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the errhandler */
|
||||
/* Return the errhandler. Do not increase the refcount here; we
|
||||
only refcount on communicators */
|
||||
|
||||
*errhandler = comm->error_handler;
|
||||
|
||||
|
@ -31,11 +31,11 @@ int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
|
||||
}
|
||||
}
|
||||
|
||||
/* Ditch the old errhandler */
|
||||
/* Ditch the old errhandler, and decrement its refcount */
|
||||
|
||||
OBJ_RELEASE(comm->error_handler);
|
||||
|
||||
/* We have a valid comm and errhandler */
|
||||
/* We have a valid comm and errhandler, so increment its refcount */
|
||||
|
||||
comm->error_handler = errhandler;
|
||||
OBJ_RETAIN(comm->error_handler);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user