Yield the thread when waiting to delete a file
This commit is contained in:
parent
8dc4696b3b
commit
d579665bd1
@ -14,6 +14,7 @@
|
||||
use crate::sys::time::SystemTime;
|
||||
use crate::sys::{c, cvt};
|
||||
use crate::sys_common::{AsInner, FromInner, IntoInner};
|
||||
use crate::thread;
|
||||
|
||||
use super::path::maybe_verbatim;
|
||||
use super::to_u16s;
|
||||
@ -1059,6 +1060,7 @@ fn copy_handle(f: &File) -> mem::ManuallyDrop<File> {
|
||||
// Otherwise return the error.
|
||||
Err(e) => return Err(e),
|
||||
}
|
||||
thread::yield_now();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1072,6 +1074,7 @@ fn copy_handle(f: &File) -> mem::ManuallyDrop<File> {
|
||||
if i == MAX_RETRIES || e.kind() != io::ErrorKind::DirectoryNotEmpty {
|
||||
return Err(e);
|
||||
}
|
||||
thread::yield_now();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user