mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-16 02:39:55 +00:00
Dont spawn thread in tests
This commit is contained in:
parent
303ac90b7c
commit
c80915e216
1 changed files with 1 additions and 5 deletions
|
@ -144,12 +144,8 @@ fn flat_map_doesnt_poll_completed_inner_stream() {
|
||||||
|
|
||||||
fn poll_next(mut self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Option<Self::Item>> {
|
fn poll_next(mut self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||||
if self.polled {
|
if self.polled {
|
||||||
let waker = ctx.waker().clone();
|
|
||||||
std::thread::spawn(move || {
|
|
||||||
std::thread::sleep(std::time::Duration::from_millis(10));
|
|
||||||
waker.wake_by_ref();
|
|
||||||
});
|
|
||||||
self.polled = false;
|
self.polled = false;
|
||||||
|
ctx.waker().wake_by_ref();
|
||||||
Poll::Pending
|
Poll::Pending
|
||||||
} else {
|
} else {
|
||||||
self.polled = true;
|
self.polled = true;
|
||||||
|
|
Loading…
Reference in a new issue