summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-12-01 19:20:05 (GMT)
committerGitHub <noreply@github.com>2020-12-01 19:20:05 (GMT)
commit3e61010340b7b545f434e3b39dbb56337f8803b5 (patch)
treedb16a6276a41cfa9d6f8c7be0d74f2b02dff038d /src/H5A.c
parentadf7b1d4cf788f25a52619f5d1c957ac5a7c345c (diff)
downloadhdf5-3e61010340b7b545f434e3b39dbb56337f8803b5.zip
hdf5-3e61010340b7b545f434e3b39dbb56337f8803b5.tar.gz
hdf5-3e61010340b7b545f434e3b39dbb56337f8803b5.tar.bz2
Expand ID dec_ref and close callbacks to allow for asynchronous close operations (#135)
* Expand ID dec_ref and close callbacks to allow for asynchronous close operations. * Fix typo * Rename token -> request, remove programmer name * H5E_ATOM to H5E_ID
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/H5A.c b/src/H5A.c
index ae54370..20d6107 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -1456,12 +1456,14 @@ H5Aclose(hid_t attr_id)
H5TRACE1("e", "i", attr_id);
/* Check arguments */
- if (NULL == H5I_object_verify(attr_id, H5I_ATTR))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
+ if (H5I_ATTR != H5I_get_type(attr_id))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute ID")
- /* Decrement references to that ID (and close it) */
+ /* Decrement the counter on the attribute ID. It will be freed if the count
+ * reaches zero.
+ */
if (H5I_dec_app_ref(attr_id) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "can't close attribute")
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "decrementing attribute ID failed")
done:
FUNC_LEAVE_API(ret_value)