summaryrefslogtreecommitdiffstats
path: root/src/H5.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-06-18 20:38:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-06-18 20:38:17 (GMT)
commitdfe4c63e1944db5bbd5fe8a468fe7191f6fb08c3 (patch)
tree81a42203b494856a470f0994e680ccc1bc115040 /src/H5.c
parente29d7fc4780c4f26602fa9f67ce52f6b13fd184b (diff)
downloadhdf5-dfe4c63e1944db5bbd5fe8a468fe7191f6fb08c3.zip
hdf5-dfe4c63e1944db5bbd5fe8a468fe7191f6fb08c3.tar.gz
hdf5-dfe4c63e1944db5bbd5fe8a468fe7191f6fb08c3.tar.bz2
[svn-r7051] Purpose:
Bug fix Description: When objects were left open in a file, the API shutdown code would end up closing property lists "out from underneath" files that were left open pending the objects in the being closed. This caused problems later when file objects would try to access their property list and fail to close, causing an infinite loop in the library shutdown. Solution: Create some dependencies in the order that APIs are shut down, trying to close "higher" level APIs before closing "low" level APIs. This still isn't precise, but it does work correctly now. Platforms tested: FreeBSD 4.8 (sleipnir) h5committest
Diffstat (limited to 'src/H5.c')
-rw-r--r--src/H5.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/H5.c b/src/H5.c
index 95dfea9..e84aebf 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -213,20 +213,35 @@ H5_term_library(void)
do {
pending = 0;
- pending += DOWN(F);
- pending += DOWN(FD);
+ /* Try to organize these so the "higher" level components get shut
+ * down before "lower" level components that they might rely on. -QAK
+ */
+ pending += DOWN(R);
pending += DOWN(D);
- pending += DOWN(Z);
pending += DOWN(G);
- pending += DOWN(FL);
- pending += DOWN(R);
+ pending += DOWN(A);
pending += DOWN(S);
pending += DOWN(TN);
pending += DOWN(T);
- pending += DOWN(A);
- pending += DOWN(AC);
- pending += DOWN(P);
- pending += DOWN(I);
+ /* Don't shut down the file code until objects in files are shut down */
+ if(pending==0)
+ pending += DOWN(F);
+
+ /* Don't shut down "low-level" components until "high-level" components
+ * have successfully shut down. This prevents property lists and IDs
+ * from being closed "out from underneath" of the high-level objects
+ * that depend on them. -QAK
+ */
+ if(pending==0) {
+ pending += DOWN(AC);
+ pending += DOWN(Z);
+ pending += DOWN(FD);
+ pending += DOWN(P);
+ pending += DOWN(I);
+ /* Don't shut down the free list code until _everything_ else is down */
+ if(pending==0)
+ pending += DOWN(FL);
+ }
} while (pending && ntries++ < 100);
if (pending) {