File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 19
19
- Fixed a bug where ` H5Pget_fapl_direct ` was only included when HDF5 was compiled
20
20
with feature ` have-parallel ` instead of ` have-direct ` .
21
21
- Fixed a missing symbol when building ` hdf5-src ` with ` libz-sys ` .
22
+ - Fixed a bug where errors were only silenced on the main thread.
22
23
23
24
## 0.8.1
24
25
Original file line number Diff line number Diff line change
1
+ use std:: sync:: atomic:: { AtomicBool , Ordering } ;
2
+
1
3
use lazy_static:: lazy_static;
2
4
use parking_lot:: ReentrantMutex ;
3
5
6
+ thread_local ! {
7
+ pub static SILENCED : AtomicBool = AtomicBool :: new( false ) ;
8
+ }
9
+
4
10
lazy_static ! {
5
11
pub ( crate ) static ref LIBRARY_INIT : ( ) = {
6
12
// No functions called here must try to create the LOCK,
29
35
ReentrantMutex :: new( ( ) )
30
36
} ;
31
37
}
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
+ } ) ;
32
48
let _guard = LOCK . lock ( ) ;
33
49
func ( )
34
50
}
You can’t perform that action at this time.
0 commit comments