Home
last modified time | relevance | path

Searched refs:block_on (Results 1 – 25 of 116) sorted by relevance

12345

/external/rust/crates/criterion/src/
Dasync_executor.rs22 fn block_on<T>(&self, future: impl Future<Output = T>) -> T; in block_on() method
30 fn block_on<T>(&self, future: impl Future<Output = T>) -> T { in block_on() method
31 futures::executor::block_on(future) in block_on()
40 fn block_on<T>(&self, future: impl Future<Output = T>) -> T { in block_on() method
41 smol::block_on(future) in block_on()
47 fn block_on<T>(&self, future: impl Future<Output = T>) -> T { in block_on() method
48 self.block_on(future) in block_on()
53 fn block_on<T>(&self, future: impl Future<Output = T>) -> T { in block_on() method
54 (*self).block_on(future) in block_on()
63 fn block_on<T>(&self, future: impl Future<Output = T>) -> T { in block_on() method
[all …]
/external/rust/crates/futures/tests/
Dasync_await_macros.rs4 use futures::executor::block_on; in poll_and_pending()
8 block_on(async { in poll_and_pending()
19 use futures::executor::block_on; in join()
30 block_on(async { in join()
44 use futures::executor::block_on; in select()
51 block_on(async { in select()
66 use futures::executor::block_on; in select_biased()
74 block_on(async { in select_biased()
90 use futures::executor::block_on; in select_streams()
100 block_on(async { in select_streams()
[all …]
Dshared.rs17 use futures::executor::block_on; in send_shared_oneshot_and_wait_on_multiple_threads()
26 assert_eq!(block_on(cloned_future).unwrap(), 6); in send_shared_oneshot_and_wait_on_multiple_threads()
33 assert_eq!(block_on(f).unwrap(), 6); in send_shared_oneshot_and_wait_on_multiple_threads()
57 use futures::executor::block_on; in drop_on_one_task_ok()
69 drop(block_on(f)); in drop_on_one_task_ok()
75 let _ = block_on(f2.map_ok(|x| tx3.send(x).unwrap()).map_err(|_| ())); in drop_on_one_task_ok()
82 let result = block_on(rx3).unwrap(); in drop_on_one_task_ok()
89 use futures::executor::block_on; in drop_in_poll()
106 assert_eq!(block_on(future1), 1); in drop_in_poll()
149 use futures::executor::block_on; in downgrade()
[all …]
Dsink.rs258 use futures::executor::block_on; in vec_sink()
266 block_on(v.flush()).unwrap(); in vec_sink()
287 use futures::executor::block_on; in send()
292 block_on(v.send(0)).unwrap(); in send()
295 block_on(v.send(1)).unwrap(); in send()
298 block_on(v.send(2)).unwrap(); in send()
304 use futures::executor::block_on; in send_all()
310 block_on(v.send_all(&mut stream::iter(vec![0, 1]).map(Ok))).unwrap(); in send_all()
313 block_on(v.send_all(&mut stream::iter(vec![2, 3]).map(Ok))).unwrap(); in send_all()
316 block_on(v.send_all(&mut stream::iter(vec![4, 5]).map(Ok))).unwrap(); in send_all()
[all …]
Dmacro_comma_support.rs4 executor::block_on, in ready()
10 block_on(future::poll_fn(|_| { in ready()
19 executor::block_on, in poll()
24 block_on(async { in poll()
32 executor::block_on, in join()
36 block_on(async { in join()
46 executor::block_on, in try_join()
51 block_on(async { in try_join()
Dio_buf_writer.rs62 use futures::executor::block_on; in buf_writer()
67 block_on(writer.write(&[0, 1])).unwrap(); in buf_writer()
71 block_on(writer.write(&[2])).unwrap(); in buf_writer()
75 block_on(writer.write(&[3])).unwrap(); in buf_writer()
79 block_on(writer.flush()).unwrap(); in buf_writer()
83 block_on(writer.write(&[4])).unwrap(); in buf_writer()
84 block_on(writer.write(&[5])).unwrap(); in buf_writer()
88 block_on(writer.write(&[6])).unwrap(); in buf_writer()
92 block_on(writer.write(&[7, 8])).unwrap(); in buf_writer()
96 block_on(writer.write(&[9, 10, 11])).unwrap(); in buf_writer()
[all …]
Dio_buf_reader.rs87 use futures::executor::block_on; in test_buffered_reader()
94 let nread = block_on(reader.read(&mut buf)); in test_buffered_reader()
100 let nread = block_on(reader.read(&mut buf)); in test_buffered_reader()
106 let nread = block_on(reader.read(&mut buf)); in test_buffered_reader()
112 let nread = block_on(reader.read(&mut buf)); in test_buffered_reader()
117 let nread = block_on(reader.read(&mut buf)); in test_buffered_reader()
122 assert_eq!(block_on(reader.read(&mut buf)).unwrap(), 0); in test_buffered_reader()
127 use futures::executor::block_on; in test_buffered_reader_seek()
135 assert_eq!(block_on(reader.seek(SeekFrom::Start(3))).ok(), Some(3)); in test_buffered_reader_seek()
139 assert_eq!(block_on(reader.seek(SeekFrom::Current(1))).ok(), Some(4)); in test_buffered_reader_seek()
[all …]
Dselect_ok.rs3 use futures::executor::block_on; in ignore_err()
13 let (i, v) = block_on(select_ok(v)).ok().unwrap(); in ignore_err()
18 let (i, v) = block_on(select_ok(v)).ok().unwrap(); in ignore_err()
26 use futures::executor::block_on; in last_err()
35 let (i, v) = block_on(select_ok(v)).ok().unwrap(); in last_err()
40 let i = block_on(select_ok(v)).err().unwrap(); in last_err()
Dselect_all.rs3 use futures::executor::block_on; in smoke()
15 let (i, idx, v) = block_on(select_all(v)); in smoke()
19 let (i, idx, v) = block_on(select_all(v)); in smoke()
23 let (i, idx, v) = block_on(select_all(v)); in smoke()
/external/rust/crates/tokio/src/sync/tests/
Dloom_mpsc.rs4 use loom::future::block_on;
19 let v = block_on(rx.recv()); in closing_tx()
22 let v = block_on(rx.recv()); in closing_tx()
37 let v = block_on(rx.recv()); in closing_unbounded_tx()
40 let v = block_on(rx.recv()); in closing_unbounded_tx()
54 block_on(tx1.closed()); in closing_bounded_rx()
55 block_on(tx2.closed()); in closing_bounded_rx()
71 block_on(tx2.closed()); in closing_and_sending()
75 let v = block_on(rx.recv()); in closing_and_sending()
95 block_on(tx1.closed()); in closing_unbounded_rx()
[all …]
Dloom_rwlock.rs3 use loom::future::block_on;
16 block_on(async { in concurrent_write()
24 block_on(async { in concurrent_write()
33 let guard = block_on(rwlock.read()); in concurrent_write()
47 block_on(async { in concurrent_read_write()
55 block_on(async { in concurrent_read_write()
63 block_on(async { in concurrent_read_write()
71 let guard = block_on(rwlock.clone().read_owned()); in concurrent_read_write()
80 let guard = block_on(rwlock.read()); in concurrent_read_write()
90 let n = block_on(lock.write()); in downgrade()
[all …]
Dloom_semaphore_batch.rs4 use loom::future::block_on;
43 block_on(actor(shared)); in basic_usage()
47 block_on(actor(shared)); in basic_usage()
59 block_on(semaphore.acquire(1)).unwrap(); in release()
64 block_on(semaphore.acquire(1)).unwrap(); in release()
82 block_on(semaphore.acquire(1)).map_err(|_| ())?; in basic_closing()
106 block_on(semaphore.acquire(1)).map_err(|_| ())?; in concurrent_close()
142 thread::spawn(move || block_on(poll_and_cancel(semaphore))) in concurrent_cancel()
146 thread::spawn(move || block_on(poll_and_cancel(semaphore))) in concurrent_cancel()
150 thread::spawn(move || block_on(poll_and_cancel(semaphore))) in concurrent_cancel()
[all …]
Dloom_broadcast.rs4 use loom::future::block_on;
17 block_on(async { in broadcast_send()
25 block_on(async { in broadcast_send()
32 block_on(async { in broadcast_send()
57 block_on(async { in broadcast_two()
72 block_on(async { in broadcast_two()
102 block_on(async { in broadcast_wrap()
118 block_on(async { in broadcast_wrap()
151 block_on(async { in drop_rx()
192 block_on(async { in drop_multiple_rx_with_overflow()
[all …]
Dloom_watch.rs3 use loom::future::block_on;
19 block_on(rx1.changed()).unwrap(); in smoke()
22 block_on(rx2.changed()).unwrap(); in smoke()
25 block_on(rx3.changed()).unwrap(); in smoke()
28 block_on(rx4.changed()).unwrap(); in smoke()
31 block_on(rx5.changed()).unwrap(); in smoke()
Dloom_notify.rs3 use loom::future::block_on;
14 block_on(async { in notify_one()
38 block_on(async { in notify_waiters()
56 block_on(async { in notify_multi()
69 block_on(async { in notify_multi()
89 block_on(poll_fn(|cx| { in notify_drop()
98 block_on(async { in notify_drop()
Dloom_oneshot.rs4 use loom::future::block_on;
17 let value = block_on(rx).unwrap(); in smoke()
32 let ready = block_on(poll_fn(|cx| match Pin::new(&mut rx).poll(cx) { in changing_rx_task()
52 let value = block_on(rx).unwrap(); in changing_rx_task()
95 let t1 = block_on(OnClose::new(&mut tx)); in changing_tx_task()
108 block_on(OnClose::new(&mut tx)); in changing_tx_task()
/external/rust/crates/futures-channel/tests/
Dmpsc.rs2 use futures::executor::{block_on, block_on_stream};
21 block_on(tx.send(1)).unwrap(); in send_recv()
23 let v: Vec<_> = block_on(rx.collect()); in send_recv()
30 block_on(poll_fn(move |cx| { in send_recv_no_buffer()
69 block_on(tx1.send(1)).unwrap(); in send_shared_recv()
72 block_on(tx2.send(2)).unwrap(); in send_shared_recv()
81 block_on(tx.send(1)).unwrap(); in send_recv_threads()
84 let v: Vec<_> = block_on(rx.take(1).collect()); in send_recv_threads()
95 block_on(tx.send(1)).unwrap(); in send_recv_threads_no_capacity()
96 block_on(tx.send(2)).unwrap(); in send_recv_threads_no_capacity()
[all …]
Dmpsc-close.rs2 use futures::executor::block_on;
17 while let Ok(()) = block_on(sender.send(42)) {} in smoke()
21 block_on(receiver.take(3).for_each(|_| futures::future::ready(()))); in smoke()
36 block_on(tx3.close()).unwrap(); in multiple_senders_disconnect()
42 block_on(tx4.send(5)).unwrap(); in multiple_senders_disconnect()
43 assert_eq!(block_on(rx.next()), Some(5)); in multiple_senders_disconnect()
47 assert_eq!(block_on(rx.next()), None); in multiple_senders_disconnect()
58 block_on(tx3.close()).unwrap(); in multiple_senders_disconnect()
64 block_on(tx4.send(5)).unwrap(); in multiple_senders_disconnect()
65 assert_eq!(block_on(rx.next()), Some(5)); in multiple_senders_disconnect()
[all …]
Dchannel.rs2 use futures::executor::block_on;
15 block_on(send_sequence(amt, tx)) in sequence()
17 let list: Vec<_> = block_on(rx.collect()); in sequence()
40 assert_eq!(block_on(f), None) in drop_sender()
46 block_on(tx.send(1)).unwrap(); in drop_rx()
48 assert!(block_on(tx.send(1)).is_err()); in drop_rx()
64 block_on(tx.send(A)).unwrap(); in drop_order()
68 assert!(block_on(tx.send(A)).is_err()); in drop_order()
Doneshot.rs2 use futures::executor::block_on;
22 block_on(f); in smoke_poll()
30 block_on(tx.cancellation()); in cancel_notifies()
41 block_on(tx.cancellation()); in cancel_lots()
71 block_on(poll_fn(|cx| { in close()
89 block_on(tx.cancellation()); in close_wakes()
116 let _ = block_on(orx); in cancel_sends()
/external/rust/crates/tokio/tests/
Drt_handle_block_on.rs98 let one = Handle::current().block_on(async { 1 }); in basic()
108 Handle::current().block_on(tx.send(42)).unwrap(); in bounded_mpsc_channel()
110 let value = Handle::current().block_on(rx.recv()).unwrap(); in bounded_mpsc_channel()
122 let value = Handle::current().block_on(rx.recv()).unwrap(); in unbounded_mpsc_channel()
136 .block_on(fs::read_to_string("Cargo.toml"))
148 .block_on(fs::read_to_string("Cargo.toml"))
163 .block_on(spawn_blocking(|| {
179 .block_on(spawn_blocking(|| {
200 let answer = Handle::current().block_on(handle).unwrap();
213 .block_on(net::TcpListener::bind("127.0.0.1:0"))
[all …]
Drt_common.rs78 rt.block_on(async {
90 let out = rt.block_on(async {
108 let out = rt.block_on(async {
125 let out = rt.block_on(async {
148 let out = rt.block_on(async {
175 let out = rt.block_on(async {
225 let out = rt.block_on(async {
281 let out = rt.block_on(async {
298 rt.block_on(async {
320 rt1.block_on(async { rt2.block_on(async { "hello" }) });
[all …]
Dtask_blocking.rs87 rt.block_on(async { in yes_block_in_threaded_block_on()
96 rt.block_on(async { in no_block_in_basic_block_on()
105 outer.block_on(async { in can_enter_basic_rt_from_within_block_in_place()
111 inner.block_on(async {}) in can_enter_basic_rt_from_within_block_in_place()
123 outer.block_on(async { in useful_panic_message_when_dropping_rt_in_rt()
145 outer.block_on(async { in can_shutdown_with_zero_timeout_in_runtime()
157 outer.block_on(async { in can_shutdown_now_in_runtime()
179 outer.block_on(async move { in coop_disabled_in_block_in_place()
182 futures::executor::block_on(async move { in coop_disabled_in_block_in_place()
210 outer.block_on(async move { in coop_disabled_in_block_in_place_in_block_on()
[all …]
/external/rust/crates/tokio-test/tests/
Dblock_on.rs4 use tokio_test::block_on;
8 assert_eq!(4, block_on(async { 4 })); in async_block()
17 assert_eq!(5, block_on(five())); in async_fn()
24 block_on(async { in test_sleep()
/external/rust/crates/tokio/src/future/
Dblock_on.rs4 pub(crate) fn block_on<F: Future>(f: F) -> F::Output {
6 e.block_on(f).unwrap()
11 pub(crate) fn block_on<F: Future>(f: F) -> F::Output {
13 park.block_on(f).unwrap()

12345