diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-22 15:00:37 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-24 23:49:11 -0700 |
| commit | 64a5c3bc1ee869990f8205374f9dac837a475dbd (patch) | |
| tree | e791509c56fd43d8a5055e4d9ca163897ed4c4b5 /src/libstd/select.rs | |
| parent | 3ee5ef12fb71be95d6e7f679900a497a2580d25e (diff) | |
| download | rust-64a5c3bc1ee869990f8205374f9dac837a475dbd.tar.gz rust-64a5c3bc1ee869990f8205374f9dac837a475dbd.zip | |
Implement a basic event loop built on LittleLock
It's not guaranteed that there will always be an event loop to run, and this implementation will serve as an incredibly basic one which does not provide any I/O, but allows the scheduler to still run. cc #9128
Diffstat (limited to 'src/libstd/select.rs')
| -rw-r--r-- | src/libstd/select.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstd/select.rs b/src/libstd/select.rs index 62a09984794..75b09187f04 100644 --- a/src/libstd/select.rs +++ b/src/libstd/select.rs @@ -183,7 +183,7 @@ mod test { #[test] fn select_one() { - do run_in_newsched_task { select_helper(1, [0]) } + do run_in_uv_task { select_helper(1, [0]) } } #[test] @@ -191,14 +191,14 @@ mod test { // NB. I would like to have a test that tests the first one that is // ready is the one that's returned, but that can't be reliably tested // with the randomized behaviour of optimistic_check. - do run_in_newsched_task { select_helper(2, [1]) } - do run_in_newsched_task { select_helper(2, [0]) } - do run_in_newsched_task { select_helper(2, [1,0]) } + do run_in_uv_task { select_helper(2, [1]) } + do run_in_uv_task { select_helper(2, [0]) } + do run_in_uv_task { select_helper(2, [1,0]) } } #[test] fn select_a_lot() { - do run_in_newsched_task { select_helper(12, [7,8,9]) } + do run_in_uv_task { select_helper(12, [7,8,9]) } } #[test] @@ -208,7 +208,7 @@ mod test { // Sends 10 buffered packets, and uses select to retrieve them all. // Puts the port in a different spot in the vector each time. - do run_in_newsched_task { + do run_in_uv_task { let (ports, _) = unzip(range(0u, 10).map(|_| stream::<int>())); let (port, chan) = stream(); do 10.times { chan.send(31337); } @@ -229,7 +229,7 @@ mod test { #[test] fn select_unkillable() { - do run_in_newsched_task { + do run_in_uv_task { do task::unkillable { select_helper(2, [1]) } } } @@ -242,7 +242,7 @@ mod test { select_blocking_helper(false); fn select_blocking_helper(killable: bool) { - do run_in_newsched_task { + do run_in_uv_task { let (p1,_c) = oneshot(); let (p2,c2) = oneshot(); let mut ports = [p1,p2]; @@ -287,7 +287,7 @@ mod test { fn select_racing_senders_helper(killable: bool, send_on_chans: ~[uint]) { use rt::test::spawntask_random; - do run_in_newsched_task { + do run_in_uv_task { // A bit of stress, since ordinarily this is just smoke and mirrors. do 4.times { let send_on_chans = send_on_chans.clone(); @@ -318,7 +318,7 @@ mod test { #[test] fn select_killed() { - do run_in_newsched_task { + do run_in_uv_task { let (success_p, success_c) = oneshot::<bool>(); let success_c = Cell::new(success_c); do task::try { |
