We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98c62d0 commit 9e9ac1aCopy full SHA for 9e9ac1a
Cargo.toml
@@ -27,6 +27,10 @@ harness = false
27
name = "large_image"
28
harness = false
29
30
+[[test]]
31
+name = "rayon"
32
+required-features = ["rayon"]
33
+
34
[features]
35
default = ["rayon"]
36
platform_independent = []
tests/rayon.rs
@@ -0,0 +1,16 @@
1
+use std::{fs::File, path::Path};
2
+use jpeg_decoder::Decoder;
3
4
+#[test]
5
+fn decoding_in_limited_threadpool_does_not_deadlock() {
6
+ let path = Path::new("tests").join("reftest").join("images").join("mozilla").join("jpg-progressive.jpg");
7
8
+ let pool = rayon::ThreadPoolBuilder::new()
9
+ .num_threads(1)
10
+ .build()
11
+ .unwrap();
12
+ pool.install(|| {
13
+ let mut decoder = Decoder::new(File::open(&path).unwrap());
14
+ let _ = decoder.decode().unwrap();
15
+ });
16
+}
0 commit comments