/external/rust/crates/tokio-stream/tests/ |
D | stream_collect.rs | 46 let mut fut = task::spawn(rx.collect::<Vec<i32>>()); in collect_vec_items() localVariable 48 assert_pending!(fut.poll()); in collect_vec_items() 51 assert!(fut.is_woken()); in collect_vec_items() 52 assert_pending!(fut.poll()); in collect_vec_items() 55 assert!(fut.is_woken()); in collect_vec_items() 56 assert_pending!(fut.poll()); in collect_vec_items() 59 assert!(fut.is_woken()); in collect_vec_items() 60 let coll = assert_ready!(fut.poll()); in collect_vec_items() 68 let mut fut = task::spawn(rx.collect::<String>()); in collect_string_items() localVariable 70 assert_pending!(fut.poll()); in collect_string_items() [all …]
|
/external/python/cpython3/Modules/ |
D | _asynciomodule.c | 77 FutureObj_HEAD(fut) 196 get_future_loop(PyObject *fut) in get_future_loop() argument 204 if (Future_CheckExact(fut) || Task_CheckExact(fut)) { in get_future_loop() 205 PyObject *loop = ((FutureObj *)fut)->fut_loop; in get_future_loop() 210 if (_PyObject_LookupAttrId(fut, &PyId_get_loop, &getloop) < 0) { in get_future_loop() 219 return _PyObject_GetAttrId(fut, &PyId__loop); in get_future_loop() 393 future_is_alive(FutureObj *fut) in future_is_alive() argument 395 return fut->fut_loop != NULL; in future_is_alive() 400 future_ensure_alive(FutureObj *fut) in future_ensure_alive() argument 402 if (!future_is_alive(fut)) { in future_ensure_alive() [all …]
|
/external/rust/crates/tokio/tests/ |
D | time_timeout.rs | 14 let mut fut = task::spawn(timeout_at(Instant::now(), async {})); in simultaneous_deadline_future_completion() localVariable 17 assert_ready_ok!(fut.poll()); in simultaneous_deadline_future_completion() 24 let mut fut = task::spawn(timeout_at(Instant::now() - ms(1000), async {})); in completed_future_past_deadline() localVariable 27 assert_ready_ok!(fut.poll()); in completed_future_past_deadline() 38 let mut fut = task::spawn(timeout_at(Instant::now() + ms(100), rx)); in future_and_deadline_in_future() localVariable 40 assert_pending!(fut.poll()); in future_and_deadline_in_future() 45 assert_pending!(fut.poll()); in future_and_deadline_in_future() 49 assert!(fut.is_woken()); in future_and_deadline_in_future() 51 assert_ready_ok!(fut.poll()).unwrap(); in future_and_deadline_in_future() 62 let mut fut = task::spawn(timeout(ms(100), rx)); in future_and_timeout_in_future() localVariable [all …]
|
D | sync_notify.rs | 127 let mut fut = Box::pin(async { in notify_in_drop_after_wake() localVariable 134 assert!(fut.as_mut().poll(&mut cx).is_pending()); in notify_in_drop_after_wake() 172 future.enter(|_, fut| assert!(!fut.enable())); in test_notify_one_after_enable() 176 future.enter(|_, fut| assert!(fut.enable())); in test_notify_one_after_enable() 184 future.enter(|_, fut| assert!(!fut.enable())); in test_poll_after_enable() 194 future.enter(|_, fut| assert!(!fut.enable())); in test_enable_after_poll() 205 future1.enter(|_, fut| assert!(fut.enable())); in test_enable_consumes_permit() 208 future2.enter(|_, fut| assert!(!fut.enable())); in test_enable_consumes_permit() 221 future.enter(|_, fut| assert_pending!(fut.poll(&mut Context::from_waker(&noop)))); in test_waker_update()
|
D | macros_join.rs | 74 let fut = async { in join_size() localVariable 78 assert_eq!(mem::size_of_val(&fut), 32); in join_size() 80 let fut = async { in join_size() localVariable 85 assert_eq!(mem::size_of_val(&fut), 40); in join_size() 132 let fut = |x, poll_order: Arc<std::sync::Mutex<Vec<i32>>>| async move { in a_different_future_is_polled_first_every_time_poll_fn_is_polled() localVariable 145 fut(1, Arc::clone(&poll_order)), in a_different_future_is_polled_first_every_time_poll_fn_is_polled() 146 fut(2, Arc::clone(&poll_order)), in a_different_future_is_polled_first_every_time_poll_fn_is_polled() 147 fut(3, Arc::clone(&poll_order)), in a_different_future_is_polled_first_every_time_poll_fn_is_polled()
|
D | macros_try_join.rs | 96 let fut = async { in join_size() localVariable 100 assert_eq!(mem::size_of_val(&fut), 32); in join_size() 102 let fut = async { in join_size() localVariable 107 assert_eq!(mem::size_of_val(&fut), 48); in join_size() 161 let fut = |x, poll_order: Arc<std::sync::Mutex<Vec<i32>>>| async move { in a_different_future_is_polled_first_every_time_poll_fn_is_polled() localVariable 174 fut(1, Arc::clone(&poll_order)), in a_different_future_is_polled_first_every_time_poll_fn_is_polled() 175 fut(2, Arc::clone(&poll_order)), in a_different_future_is_polled_first_every_time_poll_fn_is_polled() 176 fut(3, Arc::clone(&poll_order)), in a_different_future_is_polled_first_every_time_poll_fn_is_polled()
|
/external/python/cpython3/Lib/asyncio/ |
D | locks.py | 105 fut = self._get_loop().create_future() 106 self._waiters.append(fut) 113 await fut 115 self._waiters.remove(fut) 146 fut = next(iter(self._waiters)) 153 if not fut.done(): 154 fut.set_result(True) 190 for fut in self._waiters: 191 if not fut.done(): 192 fut.set_result(True) [all …]
|
D | tasks.py | 392 async def wait_for(fut, timeout): argument 408 return await fut 411 fut = ensure_future(fut, loop=loop) 413 if fut.done(): 414 return fut.result() 416 await _cancel_and_wait(fut, loop=loop) 418 return fut.result() 426 fut = ensure_future(fut, loop=loop) 427 fut.add_done_callback(cb) 434 if fut.done(): [all …]
|
D | selector_events.py | 362 fut = self.create_future() 365 handle = self._add_reader(fd, self._sock_recv, fut, sock, n) 366 fut.add_done_callback( 368 return await fut 370 def _sock_read_done(self, fd, fut, handle=None): argument 374 def _sock_recv(self, fut, sock, n): argument 377 if fut.done(): 386 fut.set_exception(exc) 388 fut.set_result(data) 403 fut = self.create_future() [all …]
|
/external/python/cpython3/Lib/test/test_asyncio/ |
D | test_futures.py | 178 fut = self.cls.__new__(self.cls, loop=self.loop) 179 self.assertRaises(asyncio.InvalidStateError, fut.result) 181 fut = self.cls.__new__(self.cls, loop=self.loop) 182 self.assertRaises(asyncio.InvalidStateError, fut.exception) 184 fut = self.cls.__new__(self.cls, loop=self.loop) 186 fut.set_result(None) 188 fut = self.cls.__new__(self.cls, loop=self.loop) 190 fut.set_exception(Exception) 192 fut = self.cls.__new__(self.cls, loop=self.loop) 194 fut.cancel() [all …]
|
D | test_windows_events.py | 166 fut = self.loop._proactor.wait_for_handle(event, 0.5) 168 done = self.loop.run_until_complete(fut) 172 self.assertFalse(fut.result()) 181 fut = self.loop._proactor.wait_for_handle(event, 10) 183 done = self.loop.run_until_complete(fut) 187 self.assertTrue(fut.result()) 192 fut.cancel() 200 fut = self.loop._proactor.wait_for_handle(event, 10) 201 fut.cancel() 204 self.loop.run_until_complete(fut) [all …]
|
D | test_tasks.py | 169 fut = self.new_future(other_loop) 171 async def run(fut): argument 172 await fut 177 self.loop.run_until_complete(run(fut)) 337 fut = asyncio.ensure_future(Aw(coro()), loop=loop) 338 loop.run_until_complete(fut) 339 self.assertEqual(fut.result(), 'ok') 525 async def wait_for(fut): argument 526 return await fut 528 fut = self.new_future(self.loop) [all …]
|
/external/python/cpython3/Lib/unittest/ |
D | async_case.py | 77 fut = self._asyncioTestLoop.create_future() 78 self._asyncioCallsQueue.put_nowait((fut, ret)) 79 return self._asyncioTestLoop.run_until_complete(fut) 85 fut = self._asyncioTestLoop.create_future() 86 self._asyncioCallsQueue.put_nowait((fut, ret)) 87 return self._asyncioTestLoop.run_until_complete(fut) 91 async def _asyncioLoopRunner(self, fut): argument 93 fut.set_result(None) 99 fut, awaitable = query 102 if not fut.cancelled(): [all …]
|
/external/rust/crates/tokio/src/macros/ |
D | try_join.rs | 165 let ( $($skip,)* fut, .. ) = &mut *futures; 169 let mut fut = unsafe { Pin::new_unchecked(fut) }; localVariable 172 if fut.as_mut().poll(cx).is_pending() { 174 … } else if fut.as_mut().output_mut().expect("expected completed future").is_err() { 175 … return Ready(Err(fut.take_output().expect("expected completed future").err().unwrap())) 189 let ( $($skip,)* fut, .. ) = &mut futures; 193 let mut fut = unsafe { Pin::new_unchecked(fut) }; localVariable 195 fut
|
D | join.rs | 119 let ( $($skip,)* fut, .. ) = &mut *futures; 123 let mut fut = unsafe { Pin::new_unchecked(fut) }; localVariable 126 if fut.poll(cx).is_pending() { 141 let ( $($skip,)* fut, .. ) = &mut futures; 145 let mut fut = unsafe { Pin::new_unchecked(fut) }; localVariable 147 fut.take_output().expect("expected completed future")
|
/external/rust/crates/futures-util/src/stream/stream/ |
D | take_until.rs | 22 fut: Option<Fut>, 37 f.debug_struct("TakeUntil").field("stream", &self.stream).field("fut", &self.fut).finish() in fmt() 46 pub(super) fn new(stream: St, fut: Fut) -> Self { in new() 47 Self { stream, fut: Some(fut), fut_result: None, free: false } in new() 57 if self.fut.is_some() { in take_future() 61 self.fut.take() in take_future() 107 !self.free && self.fut.is_none() in is_stopped() 121 if let Some(f) = this.fut.as_mut().as_pin_mut() { in poll_next() 123 this.fut.set(None); in poll_next() 128 if !*this.free && this.fut.is_none() { in poll_next() [all …]
|
/external/rust/crates/futures/tests/ |
D | async_await_macros.rs | 27 let fut = async { in join() localVariable 33 pin_mut!(fut); in join() 34 assert_eq!(Poll::Pending, poll!(&mut fut)); in join() 36 assert_eq!(Poll::Pending, poll!(&mut fut)); in join() 38 assert_eq!(Poll::Ready(()), poll!(&mut fut)); in join() 166 let fut = async { in select_size() localVariable 172 assert_eq!(mem::size_of_val(&fut), 24); in select_size() 174 let fut = async { in select_size() localVariable 182 assert_eq!(mem::size_of_val(&fut), 40); in select_size() 224 let fut = async { in select_on_non_unpin_size() localVariable [all …]
|
D | test_macro.rs | 3 let fut = async { true }; in it_works() localVariable 4 assert!(fut.await); in it_works() 6 let fut = async { false }; in it_works() localVariable 7 assert!(!fut.await); in it_works() 13 let fut = async { false }; in it_is_being_run() localVariable 14 assert!(fut.await); in it_is_being_run()
|
/external/rust/crates/futures-macro/src/ |
D | join.rs | 59 let poll_futures = future_names.iter().map(|fut| { in join() 62 #fut.as_mut(), __cx).is_ready(); in join() 65 let take_outputs = future_names.iter().map(|fut| { in join() 67 #fut.as_mut().take_output().unwrap(), in join() 97 let poll_futures = future_names.iter().map(|fut| { in try_join() 100 #fut.as_mut(), __cx).is_pending() in try_join() 103 } else if #fut.as_mut().output_mut().unwrap().is_err() { in try_join() 110 #fut.as_mut().take_output().unwrap().err().unwrap() in try_join() 116 let take_outputs = future_names.iter().map(|fut| { in try_join() 122 #fut.as_mut().take_output().unwrap().ok().unwrap(), in try_join()
|
/external/libcxx/test/std/thread/futures/futures.async/ |
D | async_race.38682.pass.cpp | 47 std::future<int> fut = std::async(std::launch::async, worker, v); in main() local 48 int answer = fut.get(); in main() 56 std::future<int&> fut = std::async(std::launch::async, worker_ref, std::ref(i)); in main() local 57 int& answer = fut.get(); in main() 65 std::future<void> fut = std::async(std::launch::async, worker_void); in main() local 66 fut.get(); in main()
|
/external/cronet/buildtools/third_party/libc++/trunk/test/std/thread/futures/futures.async/ |
D | async_race.38682.pass.cpp | 41 std::future<int> fut = std::async(std::launch::async, worker, v); in main() local 42 int answer = fut.get(); in main() 50 std::future<int&> fut = std::async(std::launch::async, worker_ref, std::ref(i)); in main() local 51 int& answer = fut.get(); in main() 59 std::future<void> fut = std::async(std::launch::async, worker_void); in main() local 60 fut.get(); in main()
|
/external/crosvm/cros_async/src/sys/ |
D | unix.rs | 38 pub fn run_one_uring<F: Future>(fut: F) -> Result<F::Output> { in run_one_uring() 40 .and_then(|ex| ex.run_until(fut)) in run_one_uring() 54 pub fn run_one_poll<F: Future>(fut: F) -> Result<F::Output> { in run_one_poll() 56 .and_then(|ex| ex.run_until(fut)) in run_one_poll() 70 pub fn run_one<F: Future>(fut: F) -> Result<F::Output> { in run_one() 72 .and_then(|ex| ex.run_until(fut)) in run_one()
|
/external/rust/crates/tokio-util/src/ |
D | context.rs | 137 let fut = me.inner; in poll() localVariable 140 fut.poll(cx) in poll() 180 fn wrap<F: Future>(&self, fut: F) -> TokioContext<F>; in wrap() 184 fn wrap<F: Future>(&self, fut: F) -> TokioContext<F> { in wrap() 186 inner: fut, in wrap()
|
/external/rust/crates/tokio-util/tests/ |
D | reusable_box.rs | 23 let fut = async move { 10 }; in test_different_futures() localVariable 25 assert_eq!(Layout::for_value(&fut).size(), 1); in test_different_futures() 27 let mut b = ReusableBoxFuture::new(fut); in test_different_futures() 71 let fut = ZeroSizedFuture {}; in test_zero_sized() localVariable 73 assert_eq!(Layout::for_value(&fut).size(), 0); in test_zero_sized() 75 let mut b = ReusableBoxFuture::new(fut); in test_zero_sized()
|
/external/rust/crates/futures-util/src/stream/try_stream/ |
D | try_unfold.rs | 64 assert_stream::<Result<Item, Fut::Error>, _>(TryUnfold { f, state: Some(init), fut: None }) in try_unfold() 74 fut: Option<Fut>, 84 f.debug_struct("TryUnfold").field("state", &self.state).field("fut", &self.fut).finish() in fmt() 99 this.fut.set(Some((this.f)(state))); in poll_next() 102 match this.fut.as_mut().as_pin_mut() { in poll_next() 109 this.fut.set(None); in poll_next()
|