Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update helpers.jl with initial value for Ref{Cuint} #1138

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gen/api_defs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@bind h5_free_memory(buf::Ptr{Cvoid})::herr_t "Error freeing memory"
@bind h5_garbage_collect()::herr_t "Error on garbage collect"
@bind h5_get_libversion(majnum::Ref{Cuint}, minnum::Ref{Cuint}, relnum::Ref{Cuint})::herr_t "Error getting HDF5 library version"
@bind h5_is_library_threadsafe(is_ts::Ref{Cuint})::herr_t "Error determining thread safety"
@bind h5_is_library_threadsafe(is_ts::Ref{Cuchar})::herr_t "Error determining thread safety"
@bind h5_open()::herr_t "Error initializing the HDF5 library"
@bind h5_set_free_list_limits(reg_global_lim::Cint, reg_list_lim::Cint, arr_global_lim::Cint, arr_list_lim::Cint, blk_global_lim::Cint, blk_list_lim::Cint)::herr_t "Error setting limits on free lists"

Expand Down
4 changes: 2 additions & 2 deletions src/api/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ function h5_get_libversion(majnum, minnum, relnum)
end

"""
h5_is_library_threadsafe(is_ts::Ref{Cuint})
h5_is_library_threadsafe(is_ts::Ref{Cuchar})

See `libhdf5` documentation for [`H5is_library_threadsafe`](https://docs.hdfgroup.org/hdf5/v1_14/group___h5.html#ga70bfde4acd009cdd7bcd2f54c594e28a).
"""
function h5_is_library_threadsafe(is_ts)
lock(liblock)
var"#status#" = try
ccall((:H5is_library_threadsafe, libhdf5), herr_t, (Ref{Cuint},), is_ts)
ccall((:H5is_library_threadsafe, libhdf5), herr_t, (Ref{Cuchar},), is_ts)
finally
unlock(liblock)
end
Expand Down
2 changes: 1 addition & 1 deletion src/api/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function h5_get_libversion()
end

function h5_is_library_threadsafe()
is_ts = Ref{Cuint}()
is_ts = Ref{Cuchar}(0)
h5_is_library_threadsafe(is_ts)
return is_ts[] > 0
end
Expand Down
Loading