diff options
| author | bors <bors@rust-lang.org> | 2013-05-18 18:37:25 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-18 18:37:25 -0700 |
| commit | 3ee479f3e98474cd8125432f7a0c5c18bc2bd342 (patch) | |
| tree | b105fbefbc8b0fce8abc62152a9bd6b9af1a6abe /src/libstd | |
| parent | 24c2be3323f088dc0e8024fc503198b2a535a09e (diff) | |
| parent | 8daa5ec9eac7148674cd63e5281c56925a3bc7b7 (diff) | |
| download | rust-3ee479f3e98474cd8125432f7a0c5c18bc2bd342.tar.gz rust-3ee479f3e98474cd8125432f7a0c5c18bc2bd342.zip | |
auto merge of #6577 : brson/rust/io-upstream, r=pcwalton
r? This is all of my scheduler work on #4419 from the last 3 weeks or so. I've had a few failed pull requests so far but I think the problems are ironed out. * TCP * The beginnings of runtime embedding APIs * Porting various corners of core to be compatible with both schedulers * libuv timer bindings * Further refinement of I/O error handling, including a new, incomplete, `read_error` condition * Incomplete refactoring to make tasks work without coroutines and user-space scheduling * Implementations of Reader/Writer extension methods * Implementations of the most important part of core::comm I'm particularly happy with how easy the [comm types on top of the scheduler](https://github.com/brson/rust/blob/io-upstream/src/libcore/rt/comm.rs). Note that these implementations do not use pipes. If anything here needs careful review though it's this code. This branch passes 95% of the run-pass tests (with `TESTARGS=--newrt`) In the next week I'll probably spend some time adding preliminary multithreading and seeing how close we are to removing the old runtime.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/future.rs | 10 | ||||
| -rw-r--r-- | src/libstd/uv_ll.rs | 8 | ||||
| -rw-r--r-- | src/libstd/workcache.rs | 7 |
3 files changed, 9 insertions, 16 deletions
diff --git a/src/libstd/future.rs b/src/libstd/future.rs index ef9318e8d3d..93b6540a40d 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -25,8 +25,7 @@ use core::cast; use core::cell::Cell; -use core::comm::{PortOne, oneshot, send_one}; -use core::pipes::recv; +use core::comm::{PortOne, oneshot, send_one, recv_one}; use core::task; use core::util::replace; @@ -107,11 +106,8 @@ pub fn from_port<A:Owned>(port: PortOne<A>) -> Future<A> { */ let port = Cell(port); - do from_fn || { - let port = port.take().unwrap(); - match recv(port) { - oneshot::send(data) => data - } + do from_fn { + recv_one(port.take()) } } diff --git a/src/libstd/uv_ll.rs b/src/libstd/uv_ll.rs index 37052f7d1b7..bc7703ec30a 100644 --- a/src/libstd/uv_ll.rs +++ b/src/libstd/uv_ll.rs @@ -819,8 +819,8 @@ extern { unsafe fn rust_uv_timer_start( timer_handle: *uv_timer_t, cb: *u8, - timeout: libc::c_uint, - repeat: libc::c_uint) -> libc::c_int; + timeout: libc::uint64_t, + repeat: libc::uint64_t) -> libc::c_int; unsafe fn rust_uv_timer_stop(handle: *uv_timer_t) -> libc::c_int; unsafe fn rust_uv_getaddrinfo(loop_ptr: *libc::c_void, @@ -1084,8 +1084,8 @@ pub unsafe fn timer_init(loop_ptr: *libc::c_void, } pub unsafe fn timer_start(timer_ptr: *uv_timer_t, cb: *u8, timeout: uint, repeat: uint) -> libc::c_int { - return rust_uv_timer_start(timer_ptr, cb, timeout as libc::c_uint, - repeat as libc::c_uint); + return rust_uv_timer_start(timer_ptr, cb, timeout as libc::uint64_t, + repeat as libc::uint64_t); } pub unsafe fn timer_stop(timer_ptr: *uv_timer_t) -> libc::c_int { return rust_uv_timer_stop(timer_ptr); diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index f173df60df8..3889650d012 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -15,11 +15,10 @@ use sort; use core::cell::Cell; use core::cmp; -use core::comm::{PortOne, oneshot, send_one}; +use core::comm::{PortOne, oneshot, send_one, recv_one}; use core::either::{Either, Left, Right}; use core::hashmap::HashMap; use core::io; -use core::pipes::recv; use core::run; use core::to_bytes; use core::util::replace; @@ -389,9 +388,7 @@ fn unwrap<T:Owned + None => fail!(), Some(Left(v)) => v, Some(Right(port)) => { - let (exe, v) = match recv(port.unwrap()) { - oneshot::send(data) => data - }; + let (exe, v) = recv_one(port); let s = json_encode(&v); |
