Skip to content

Commit

Permalink
deprecate crossbeam since it is merged with std
Browse files Browse the repository at this point in the history
Signed-off-by: yihuaf <yihuaf@unkies.org>
  • Loading branch information
yihuaf committed May 29, 2023
1 parent 4ba681f commit 32f57e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 40 deletions.
35 changes: 1 addition & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions crates/libcontainer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ test_utils = ["dep:rand"]
bitflags = "2.3.1"
caps = "0.5.5"
chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] }
crossbeam-channel = "0.5"
fastrand = "^1.7.0"
futures = { version = "0.3", features = ["thread-pool"] }
libc = "0.2.144"
mio = { version = "0.8.7", features = ["os-ext", "os-poll"] }
nix = "0.26.2"
path-clean = "1.0.1"
oci-spec = { version = "^0.6.0", features = ["runtime"] }
once_cell = "1.17.1"
procfs = "0.15.1"
Expand All @@ -39,7 +36,6 @@ libcgroups = { version = "0.0.5", path = "../libcgroups", default-features = fal
libseccomp = { version = "0.3.0", optional=true }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
syscalls = "0.6.12"
rust-criu = "0.4.0"
clone3 = "0.2.3"
regex = "1.8.3"
Expand Down
4 changes: 2 additions & 2 deletions crates/libcontainer/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ pub fn run_hooks(hooks: Option<&Vec<Hook>>, container: Option<&Container>) -> Re
// use pid to identify the process and send a kill signal. This
// is what the Command.kill() does under the hood anyway. When
// timeout, we have to kill the process and clean up properly.
let (s, r) = crossbeam_channel::unbounded();
let (s, r) = std::sync::mpsc::channel();
thread::spawn(move || {
let res = hook_process.wait();
let _ = s.send(res);
});
match r.recv_timeout(time::Duration::from_secs(timeout_sec as u64)) {
Ok(res) => res,
Err(crossbeam_channel::RecvTimeoutError::Timeout) => {
Err(std::sync::mpsc::RecvTimeoutError::Timeout) => {
// Kill the process. There is no need to further clean
// up because we will be error out.
let _ = signal::kill(hook_process_pid, signal::Signal::SIGKILL);
Expand Down

0 comments on commit 32f57e5

Please sign in to comment.