diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2008-08-19 16:36:55 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2008-08-19 16:36:55 (GMT) |
commit | 4b141cbc6a55a02b3191db75ef40450d4bc9d92d (patch) | |
tree | ca07875ee7b217123e5c330671a38da5bc33c2ae /src/H5Dfill.c | |
parent | e660080290417487a8caf2b14055eda6b39e9f6e (diff) | |
download | hdf5-4b141cbc6a55a02b3191db75ef40450d4bc9d92d.zip hdf5-4b141cbc6a55a02b3191db75ef40450d4bc9d92d.tar.gz hdf5-4b141cbc6a55a02b3191db75ef40450d4bc9d92d.tar.bz2 |
[svn-r15486] 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.c | 12 |
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) |