diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-10-02 09:57:26 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-10-02 09:57:26 (GMT) |
commit | 9bc29ea538b9ce2013a8cde5be230c18cf052009 (patch) | |
tree | 0cafa58d457568fe89a36243caef60da30571af6 /src/H5HFhdr.c | |
parent | a03647db10e8f80b9ff132b8e43a795547ffad42 (diff) | |
download | hdf5-9bc29ea538b9ce2013a8cde5be230c18cf052009.zip hdf5-9bc29ea538b9ce2013a8cde5be230c18cf052009.tar.gz hdf5-9bc29ea538b9ce2013a8cde5be230c18cf052009.tar.bz2 |
[svn-r12699] Description:
Fix problems with opening a fractal heap multiple times, from different
file handles.
Tested on:
FreeBSD/32 4.11 (sleipnir) w/threadsafe
Linux/32 2.4 (heping) w/FORTRAN & C++
Linux/64 2.4 (mir) w/enable-v1.6
Mac OS/32 10.4.8 (amazon)
Diffstat (limited to 'src/H5HFhdr.c')
-rw-r--r-- | src/H5HFhdr.c | 65 |
1 files changed, 62 insertions, 3 deletions
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 5b9022c..adc1859 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -512,7 +512,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF_hdr_incr * - * Purpose: Increment reference count on shared heap header + * Purpose: Increment component reference count on shared heap header * * Return: Non-negative on success/Negative on failure * @@ -548,7 +548,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF_hdr_decr * - * Purpose: Decrement reference count on shared heap header + * Purpose: Decrement component reference count on shared heap header * * Return: Non-negative on success/Negative on failure * @@ -573,9 +573,11 @@ H5HF_hdr_decr(H5HF_hdr_t *hdr) hdr->rc--; /* Mark header as evictable again when no child blocks depend on it */ - if(hdr->rc == 0) + if(hdr->rc == 0) { + HDassert(hdr->file_rc == 0); if(H5AC_unpin_entry(hdr->f, hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap header") + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -583,6 +585,63 @@ done: /*------------------------------------------------------------------------- + * Function: H5HF_hdr_fuse_incr + * + * Purpose: Increment file reference count on shared heap header + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Oct 1 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_hdr_fuse_incr) + + /* Sanity check */ + HDassert(hdr); + + /* Increment file reference count on shared header */ + hdr->file_rc++; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF_hdr_fuse_incr() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_hdr_fuse_decr + * + * Purpose: Decrement file reference count on shared heap header + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Oct 1 2006 + * + *------------------------------------------------------------------------- + */ +size_t +H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_hdr_fuse_decr) + + /* Sanity check */ + HDassert(hdr); + HDassert(hdr->file_rc); + + /* Decrement file reference count on shared header */ + hdr->file_rc--; + + FUNC_LEAVE_NOAPI(hdr->file_rc) +} /* end H5HF_hdr_fuse_decr() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_hdr_dirty * * Purpose: Mark heap header as dirty |