mirror of
https://github.com/erg-lang/erg.git
synced 2025-07-19 02:55:49 +00:00
chore: add safe_yield
This commit is contained in:
parent
82792aca80
commit
bcd4e4deb7
2 changed files with 8 additions and 2 deletions
|
@ -50,3 +50,8 @@ where
|
|||
.spawn(run)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn safe_yield() {
|
||||
std::thread::yield_now();
|
||||
std::thread::sleep(std::time::Duration::from_millis(10));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue