Skip to content

Commit 8c5e127

Browse files
committed
fix deadlocks
1 parent 88945f3 commit 8c5e127

12 files changed

+330
-360
lines changed

Cargo.toml

+10-9
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,25 @@ path = "src/main.rs"
1919
[dependencies]
2020
rand = "0.8.5"
2121
smartstring = { version = "1.0.1", optional = true }
22-
smol_str = { version = "0.2.0", optional = true }
23-
compact_str = { version = "0.7.0", optional = true }
22+
smol_str = { version = "0.3.2", optional = true }
23+
compact_str = { version = "0.9.0", optional = true }
2424
kstring = { version = "2.0.0", optional = true }
25-
noodles = { version = "0.85.0" }
25+
noodles = { version = "0.97.0" }
2626
flate2 = "1.0.26"
2727
clap = { version = "4.2.7", features = ['derive'] }
28-
env_logger = "0.10.0"
28+
env_logger = "0.11.8"
2929
log = "0.4.19"
3030
linear-map = "1.2.0"
31-
hashbrown = "0.14.0"
31+
hashbrown = "0.15.2"
3232
mimalloc = "0.1.39"
3333
bitflags = "2.4.0"
3434
rust-htslib = { git = "https://github.com/brentp/rust-htslib.git", rev = "0471b48" }
3535
tempfile = "^3.14.0"
36-
simplebed = { git = "https://github.com/brentp/simplebed-rs.git", rev = "924f8e4" }
37-
pyo3 = {version = "0.23.4", features=["auto-initialize"]}
38-
pyo3-ffi = "0.23.4"
36+
simplebed = { git = "https://github.com/brentp/simplebed-rs.git", rev = "4471cdc" }
37+
pyo3 = {version = "0.24.1", features=["auto-initialize"]}
38+
pyo3-ffi = "0.24.1"
3939
mlua = {version = "0.10.3", features=["luau", "send"]}
40+
parking_lot = {version="0.12.3"}
4041

4142

4243
[features]
@@ -52,7 +53,7 @@ core = ["noodles/core"]
5253
dyn_positioned = []
5354

5455
[dev-dependencies]
55-
criterion = { version = "0.4", features = ["html_reports"] }
56+
criterion = { version = "0.5.1", features = ["html_reports"] }
5657
clap = { version = "4.5.21", features = ["derive"] }
5758

5859
[[bench]]

examples/intersect.rs

-163
This file was deleted.

src/column.rs

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::intersection::Intersections;
2-
use crate::py::{CompiledPython, PyReportOptions};
2+
use crate::py::CompiledPython;
33
use crate::report_options::ReportOptions;
44
use std::sync::Arc;
55
#[derive(Debug, PartialEq)]
@@ -215,21 +215,29 @@ impl ColumnReporter for Column<'_> {
215215
Ok(Value::Int(total_bases))
216216
}
217217
Some(ValueParser::ChromStartEnd) => {
218+
let base_interval = r
219+
.base_interval
220+
.try_lock()
221+
.expect("failed to lock base_interval");
218222
let s = format!(
219223
"{}\t{}\t{}",
220-
r.base_interval.chrom(),
221-
r.base_interval.start(),
222-
r.base_interval.stop()
224+
base_interval.chrom(),
225+
base_interval.start(),
226+
base_interval.stop()
223227
);
224228
Ok(Value::String(s))
225229
}
226230
Some(ValueParser::OriginalInterval) => {
227231
// Return the original interval as a string
232+
let base_interval = r
233+
.base_interval
234+
.try_lock()
235+
.expect("failed to lock base_interval");
228236
let s = format!(
229237
"{}\t{}\t{}",
230-
r.base_interval.chrom(),
231-
r.base_interval.start(),
232-
r.base_interval.stop()
238+
base_interval.chrom(),
239+
base_interval.start(),
240+
base_interval.stop()
233241
);
234242
Ok(Value::String(s))
235243
}

0 commit comments

Comments
 (0)