1
1

Make sure we do the right thing with refcounts on errhandler

This commit was SVN r989.
Этот коммит содержится в:
Jeff Squyres 2004-03-27 03:13:54 +00:00
родитель e51724a75f
Коммит a37a5438c7
3 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -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);