summaryrefslogtreecommitdiffstats
path: root/src/H5Dfill.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2008-08-19 16:35:16 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2008-08-19 16:35:16 (GMT)
commita59d91d19251163b0e9cfeb351f8a069d6e6fd64 (patch)
treef70ca52185d816ce92ac89414d4fa331ba600b68 /src/H5Dfill.c
parent936e52b581b3f4739e12c331d93ba6259a2cb5e0 (diff)
downloadhdf5-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/H5Dfill.c')
-rw-r--r--src/H5Dfill.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5Dfill.c b/src/H5Dfill.c
index 4879f4d..6bc635e 100644
--- a/src/H5Dfill.c
+++ b/src/H5Dfill.c
@@ -229,10 +229,10 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf,
/* Construct source & destination datatype IDs, if we will need them */
if(!H5T_path_noop(tpath)) {
- if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill_type, H5T_COPY_ALL))) < 0)
+ if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill_type, H5T_COPY_ALL), FALSE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion")
- if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(buf_type, H5T_COPY_ALL))) < 0)
+ if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(buf_type, H5T_COPY_ALL), FALSE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion")
} /* end if */
@@ -332,9 +332,9 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf,
} /* end else */
done:
- if(src_id != (-1) && H5I_dec_ref(src_id) < 0)
+ if(src_id != (-1) && H5I_dec_ref(src_id, FALSE) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID")
- if(dst_id != (-1) && H5I_dec_ref(dst_id) < 0)
+ if(dst_id != (-1) && H5I_dec_ref(dst_id, FALSE) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID")
if(tmp_buf)
(void)H5FL_BLK_FREE(type_conv, tmp_buf);
@@ -402,7 +402,7 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf,
/* Create temporary datatype for conversion operation */
if(NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_REOPEN)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy file datatype")
- if((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type)) < 0)
+ if((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type, FALSE)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype")
/* Retrieve sizes of memory & file datatypes */
@@ -673,7 +673,7 @@ H5D_fill_term(H5D_fill_buf_info_t *fb_info)
/* Free other resources for vlen fill values */
if(fb_info->has_vlen_fill_type) {
if(fb_info->mem_tid > 0)
- H5I_dec_ref(fb_info->mem_tid);
+ H5I_dec_ref(fb_info->mem_tid, FALSE);
else if(fb_info->mem_type)
H5T_close(fb_info->mem_type);
if(fb_info->bkg_buf)