summaryrefslogtreecommitdiffstats
path: root/src/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'src/sandbox')
-rw-r--r--src/sandbox/agent.rs6
-rw-r--r--src/sandbox/remote.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/sandbox/agent.rs b/src/sandbox/agent.rs
index e9626f6..3eaa799 100644
--- a/src/sandbox/agent.rs
+++ b/src/sandbox/agent.rs
@@ -52,8 +52,8 @@ pub fn serve(opts: &AgentOptions) -> Result<()> {
{
let (last, child, alive, ttl) =
(last_inbound.clone(), child.clone(), alive.clone(), ttl);
- std::thread::spawn(move || loop {
- std::thread::sleep(Duration::from_millis(1000));
+ std::thread::spawn(crate::time::inherit(move || loop {
+ crate::time::sleep(Duration::from_secs(1));
let quiet = last.lock().unwrap().elapsed();
if quiet > ttl {
eprintln!("agent: hub silent for {quiet:?} past the TTL; dying");
@@ -67,7 +67,7 @@ pub fn serve(opts: &AgentOptions) -> Result<()> {
if !alive.load(Ordering::Relaxed) {
return;
}
- });
+ }));
}
let mut outcome = Ok(());
diff --git a/src/sandbox/remote.rs b/src/sandbox/remote.rs
index ba70155..51ec047 100644
--- a/src/sandbox/remote.rs
+++ b/src/sandbox/remote.rs
@@ -140,9 +140,9 @@ impl Sandbox for RemoteSandbox {
let mut writer = self.writer.lock().unwrap().try_clone()?;
{
let (stop, interval) = (stop.clone(), self.ttl / 3);
- std::thread::spawn(move || {
+ std::thread::spawn(crate::time::inherit(move || {
while !stop.load(Ordering::SeqCst) {
- std::thread::sleep(interval.max(std::time::Duration::from_millis(50)));
+ crate::time::sleep(interval.max(std::time::Duration::from_millis(50)));
if stop.load(Ordering::SeqCst) {
break;
}
@@ -150,7 +150,7 @@ impl Sandbox for RemoteSandbox {
break;
}
}
- });
+ }));
}
let mut stdout = Vec::new();
let mut stderr = Vec::new();