File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1919- Fixed a bug where ` H5Pget_fapl_direct ` was only included when HDF5 was compiled
2020 with feature ` have-parallel ` instead of ` have-direct ` .
2121- Fixed a missing symbol when building ` hdf5-src ` with ` libz-sys ` .
22+ - Fixed a bug where errors were only silenced on the main thread.
2223
2324## 0.8.1
2425
Original file line number Diff line number Diff line change 1+ use std:: sync:: atomic:: { AtomicBool , Ordering } ;
2+
13use lazy_static:: lazy_static;
24use parking_lot:: ReentrantMutex ;
35
6+ thread_local ! {
7+ pub static SILENCED : AtomicBool = AtomicBool :: new( false ) ;
8+ }
9+
410lazy_static ! {
511 pub ( crate ) static ref LIBRARY_INIT : ( ) = {
612 // No functions called here must try to create the LOCK,
2935 ReentrantMutex :: new( ( ) )
3036 } ;
3137 }
38+ SILENCED . with ( |silence| {
39+ let is_silenced = silence. load ( Ordering :: Acquire ) ;
40+ if !is_silenced {
41+ let _guard = LOCK . lock ( ) ;
42+ unsafe {
43+ crate :: error:: silence_errors_no_sync ( true ) ;
44+ }
45+ silence. store ( true , Ordering :: Release ) ;
46+ }
47+ } ) ;
3248 let _guard = LOCK . lock ( ) ;
3349 func ( )
3450}
You can’t perform that action at this time.
0 commit comments