dont spin at max speed when waiting for foreground process

Signed-off-by: Ava Hahn <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2023-10-18 14:29:53 -07:00
parent e042cd1152
commit 5dcf601384
2 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,3 @@
#+Title: Relish: Rusty Expressive LIsp SHell #+Title: Relish: Rusty Expressive LIsp SHell
#+Author: Ava Hahn #+Author: Ava Hahn
@ -155,9 +154,8 @@ Note: this section only tracks the state of incomplete TODO items. Having everyt
** DONE Beta tasks ** DONE Beta tasks
(See tag: v0.3.0) (See tag: v0.3.0)
** TODO v1.0 tasks ** TODO v1.0 tasks
- set library
- Can pass args to relish scripts (via interpreter)
- Can pass args to relish scripts (via command line) - Can pass args to relish scripts (via command line)
- Can pass args to relish scripts (via interpreter)
- finish basic goals in the [[file:snippets/interactive-devel.rls][interactive development library]] - finish basic goals in the [[file:snippets/interactive-devel.rls][interactive development library]]
- Release CI - Release CI
- Rename to Flesh - Rename to Flesh
@ -167,7 +165,6 @@ Note: this section only tracks the state of incomplete TODO items. Having everyt
- finish stretch goals in the [[file:snippets/interactive-devel.rls][interactive development library]] - finish stretch goals in the [[file:snippets/interactive-devel.rls][interactive development library]]
- History length configurable (env var?) - History length configurable (env var?)
- Lex function - Lex function
- Read function (Input + Lex)
- execute configurable function on cd - execute configurable function on cd
- Post to relevant channels - Post to relevant channels
- Implement Compose for lambdas - Implement Compose for lambdas

View file

@ -50,6 +50,8 @@ use {
env::set_current_dir, env::set_current_dir,
os::unix::process::CommandExt, os::unix::process::CommandExt,
mem, mem,
thread,
time::Duration,
}, },
nix::{ nix::{
unistd, unistd::Pid, unistd, unistd::Pid,
@ -253,6 +255,9 @@ fn make_foreground(pid: u32, state: &mut ShellState) -> Result<(), String>{
.unwrap_or(-1); .unwrap_or(-1);
break; break;
} else {
// sleep 1 sec
thread::sleep(Duration::from_millis(1000));
} }
}, },
Err(e) => { Err(e) => {