diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2008-08-19 16:35:16 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2008-08-19 16:35:16 (GMT) |
commit | a59d91d19251163b0e9cfeb351f8a069d6e6fd64 (patch) | |
tree | f70ca52185d816ce92ac89414d4fa331ba600b68 /src/H5Z.c | |
parent | 936e52b581b3f4739e12c331d93ba6259a2cb5e0 (diff) | |
download | hdf5-a59d91d19251163b0e9cfeb351f8a069d6e6fd64.zip hdf5-a59d91d19251163b0e9cfeb351f8a069d6e6fd64.tar.gz hdf5-a59d91d19251163b0e9cfeb351f8a069d6e6fd64.tar.bz2 |
[svn-r15485] Purpose: Allow library to shut down properly when objects have reference count
> 1.
Description: Added a new field 'app_count' to H5I_id_info_t struct, to track
the reference count on an id due to the application. the old 'count' field
tracks the total. Generally any id visible to the application gets placed
in app_count. Added app_ref boolean parameter to H5I_inc_ref, H5I_dec_ref,
H5I_register, H5I_clear_type, and a few other functions, to specify whether
the operation(s) being performed on the id(s) are due to the application
(TRUE) or not (FALSE). Test added for this case.
Tested: kagiso, smirom, linew (h5committest)
Diffstat (limited to 'src/H5Z.c')
-rw-r--r-- | src/H5Z.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -518,7 +518,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Get ID for dataspace to pass to filter routines */ - if ((space_id=H5I_register (H5I_DATASPACE, space))<0) { + if ((space_id=H5I_register (H5I_DATASPACE, space, FALSE))<0) { (void)H5S_close(space); HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ @@ -552,7 +552,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty /* Check return value */ if(status<=0) { /* We're leaving, so close dataspace */ - if(H5I_dec_ref(space_id)<0) + if(H5I_dec_ref(space_id, FALSE)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") /* Indicate filter can't apply to this combination of parameters */ @@ -573,7 +573,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty /* Make callback to filter's "set local" function */ if((fclass->set_local)(dcpl_id, type_id, space_id)<0) { /* We're leaving, so close dataspace */ - if(H5I_dec_ref(space_id)<0) + if(H5I_dec_ref(space_id, FALSE)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") /* Indicate error during filter callback */ @@ -589,7 +589,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty } /* end for */ /* Close dataspace */ - if(H5I_dec_ref(space_id)<0) + if(H5I_dec_ref(space_id, FALSE)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") } /* end if */ } /* end if */ |