summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-11-21 03:36:51 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-11-21 03:36:51 (GMT)
commit7488c6366e878651f6bb8dc94f05eb69cd0df83b (patch)
treec2ba0295a0bec1b350fa3d4fa291b46ac75e271f /src/H5private.h
parent6345a417a3930b32ec9e5fc087e0aeb20a94aed7 (diff)
downloadhdf5-7488c6366e878651f6bb8dc94f05eb69cd0df83b.zip
hdf5-7488c6366e878651f6bb8dc94f05eb69cd0df83b.tar.gz
hdf5-7488c6366e878651f6bb8dc94f05eb69cd0df83b.tar.bz2
[svn-r936] Changes since 19981119
---------------------- ./src/H5.c ./src/H5A.c ./src/H5AC.c ./src/H5B.c ./src/H5D.c ./src/H5E.c ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fmpio.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5Gstab.c ./src/H5HG.c ./src/H5HL.c ./src/H5I.c ./src/H5Iprivate.h ./src/H5MF.c ./src/H5MM.c ./src/H5O.c ./src/H5Oattr.c ./src/H5Ocomp.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Ofill.c ./src/H5Olayout.c ./src/H5Omtime.c ./src/H5Oname.c ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5R.c ./src/H5RA.c ./src/H5S.c ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Smpio.c ./src/H5Snone.c ./src/H5Spoint.c ./src/H5Sselect.c ./src/H5T.c ./src/H5TB.c ./src/H5Tbit.c ./src/H5Tconv.c ./src/H5V.c ./src/H5Z.c ./src/H5detect.c ./src/H5private.h Most of these changes are because the `interface_initialize_g' variable change from hbool_t to int. It's a one line change. Changed the way the library is closed so we have more control over the order the interfaces are shut down. Instead of registering an atexit() function for every interface in some haphazard order we just register one: H5_term_library() which then calls the H5*_term_interface() functions in a well-defined order. If the library is closed and then reopened repeatedly by calling H5close() and H5open() in a loop we only add one copy of the library termination functions with atexit(). Termination is a two-step process in order to help detect programming errors that would cause an infinite loop caused by the termination of one interface waking up some other previously terminated interface. The first step terminates the interface and *marks it as unusable*. After all interfaces are terminated then we mark them all as usable again. The FUNC_ENTER() macro has been modified to return failure or to dump core (depending on whether NDEBUG is defined) if we try to call an interface while it's shutting down. ./src/H5.c The H5dont_atexit() function returns failure if it's called more than once or if it's called too late. However, the error stack is not automatically printed on failure because the library might not be initialized yet ./test/chunk.c ./test/flush1.c ./test/flush2.c ./test/iopipe.c ./test/overhead.c ./test/ragged.c Changed the extra cast for Win32 so we do floating point division again -- it was just confusion about precedence and associativity of casting and the C coercion rules. Removed extra carriage returns inserted by broken operating system. ./src/H5Ffamily.c Fixed an bug where H5F_fam_write() lowered the EOF marker for one of the family members causing H5F_fam_read() to read zeros. ./test/h5test.h [NEW] ./test/h5test.c [NEW] ./test/Makefile.in ./test/bittests.c ./test/cmpd_dset.c ./test/dsets.c ./test/dtypes.c ./test/extend.c ./test/external.c Support library for test files. This isn't done yet but Katie's contractions are ~10 minutes apart so I figured I better back this stuff up just in case I'm not here next week... Eventually all test files will understand HDF5_DRIVER to name the low level file driver and parameters so we can easily test various drivers. They will also understand HDF5_PREFIX to prepend to the beginning of file names which is necessary for testing ROMIO with various drivers. Also, the cleanup function will know how to use the file name prefix and will understand different file driver naming schemes like file families. I'm not sure they'll understand the `gsf:' type prefixes yet. Note, the external test is completely commented out because I'm in the middle of modifying it. It will still compile and run but it doesn't test anything at the moment.
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 87d973a..1e55eb3 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -818,7 +818,6 @@ void H5_trace (hbool_t returning, const char *func, const char *type, ...);
*-------------------------------------------------------------------------
*/
extern hbool_t library_initialize_g; /*good thing C's lazy about extern! */
-extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */
/* Is `S' the name of an API function? */
#define H5_IS_API(S) ('_'!=S[2] && '_'!=S[3] && (!S[4] || '_'!=S[4]))
@@ -839,18 +838,9 @@ extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */
HRETURN_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
"library initialization failed"); \
} \
- } \
+ } \
\
- /* Initialize this thread */ \
- if (!thread_initialize_g) { \
- thread_initialize_g = TRUE; \
- if (H5_init_thread()<0) { \
- HRETURN_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
- "thread initialization failed"); \
- } \
- } \
- \
- /* Initialize this interface */ \
+ /* Initialize this interface or bust */ \
if (!interface_initialize_g) { \
interface_initialize_g = TRUE; \
if (interface_init_func && \
@@ -858,10 +848,14 @@ extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */
HRETURN_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
"interface initialization failed"); \
} \
+ } else if (interface_initialize_g<0) { \
+ HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, err, \
+ "interface is closing"); \
+ assert("interface is closing" && 0); \
} \
\
/* Clear thread error stack entering public functions */ \
- if (H5E_clearable_g && H5_IS_API (FUNC)) { \
+ if (H5E_clearable_g && H5_IS_API (FUNC)) { \
H5E_clear (); \
} \
{
@@ -901,8 +895,21 @@ extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */
/* Private functions, not part of the publicly documented API */
herr_t H5_init_library(void);
void H5_term_library(void);
-herr_t H5_add_exit(void (*func) (void));
-herr_t H5_init_thread(void);
-void H5_term_thread(void);
+
+/* Functions to terminate interfaces */
+void H5A_term_interface(intn status);
+void H5D_term_interface(intn status);
+void H5F_term_interface(intn status);
+void H5G_term_interface(intn status);
+void H5I_term_interface(intn status);
+void H5P_term_interface(intn status);
+void H5RA_term_interface(intn status);
+void H5R_term_interface(intn status);
+void H5S_term_interface(intn status);
+void H5TB_term_interface(intn status);
+void H5T_native_close(intn status);
+void H5T_term_interface(intn status);
+void H5Z_term_interface(intn status);
+
#endif