Skip to content

Commit c635a25

Browse files
committed
Add is_library_threadsafe()
1 parent aa1783b commit c635a25

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ pub fn hdf5_version() -> (u8, u8, u8) {
123123
.unwrap_or((0, 0, 0))
124124
}
125125

126+
/// Returns true if the HDF5 library is threadsafe.
127+
pub fn is_library_threadsafe() -> bool {
128+
use self::internal_prelude::hbool_t;
129+
use hdf5_sys::h5::H5is_library_threadsafe;
130+
let mut ts: hbool_t = 0;
131+
h5call!(H5is_library_threadsafe(&mut ts)).map(|_| ts > 0).unwrap_or(false)
132+
}
133+
126134
#[cfg(test)]
127135
pub mod tests {
128136
use super::hdf5_version;

0 commit comments

Comments
 (0)