std: More camel casing
This commit is contained in:
parent
d8b34b2af8
commit
94720fcea7
7 changed files with 59 additions and 50 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import vec;
|
import vec;
|
||||||
import uint;
|
import uint;
|
||||||
import iotask = uv::iotask::iotask;
|
import iotask = uv::iotask::IoTask;
|
||||||
import interact = uv::iotask::interact;
|
import interact = uv::iotask::interact;
|
||||||
|
|
||||||
import sockaddr_in = uv::ll::sockaddr_in;
|
import sockaddr_in = uv::ll::sockaddr_in;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import ip = net_ip;
|
import ip = net_ip;
|
||||||
import uv::iotask;
|
import uv::iotask;
|
||||||
import uv::iotask::iotask;
|
import uv::iotask::IoTask;
|
||||||
import future_spawn = future::spawn;
|
import future_spawn = future::spawn;
|
||||||
// FIXME #1935
|
// FIXME #1935
|
||||||
// should be able to, but can't atm, replace w/ result::{result, extensions};
|
// should be able to, but can't atm, replace w/ result::{result, extensions};
|
||||||
|
@ -119,7 +119,7 @@ enum tcp_connect_err_data {
|
||||||
* `net::tcp::tcp_connect_err_data` instance will be returned
|
* `net::tcp::tcp_connect_err_data` instance will be returned
|
||||||
*/
|
*/
|
||||||
fn connect(-input_ip: ip::ip_addr, port: uint,
|
fn connect(-input_ip: ip::ip_addr, port: uint,
|
||||||
iotask: iotask)
|
iotask: IoTask)
|
||||||
-> result::Result<tcp_socket, tcp_connect_err_data> unsafe {
|
-> result::Result<tcp_socket, tcp_connect_err_data> unsafe {
|
||||||
let result_po = core::comm::Port::<conn_attempt>();
|
let result_po = core::comm::Port::<conn_attempt>();
|
||||||
let closed_signal_po = core::comm::Port::<()>();
|
let closed_signal_po = core::comm::Port::<()>();
|
||||||
|
@ -560,7 +560,7 @@ fn accept(new_conn: tcp_new_connection)
|
||||||
* of listen exiting because of an error
|
* of listen exiting because of an error
|
||||||
*/
|
*/
|
||||||
fn listen(-host_ip: ip::ip_addr, port: uint, backlog: uint,
|
fn listen(-host_ip: ip::ip_addr, port: uint, backlog: uint,
|
||||||
iotask: iotask,
|
iotask: IoTask,
|
||||||
on_establish_cb: fn~(comm::Chan<Option<tcp_err_data>>),
|
on_establish_cb: fn~(comm::Chan<Option<tcp_err_data>>),
|
||||||
+new_connect_cb: fn~(tcp_new_connection,
|
+new_connect_cb: fn~(tcp_new_connection,
|
||||||
comm::Chan<Option<tcp_err_data>>))
|
comm::Chan<Option<tcp_err_data>>))
|
||||||
|
@ -577,7 +577,7 @@ fn listen(-host_ip: ip::ip_addr, port: uint, backlog: uint,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
|
fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
|
||||||
iotask: iotask,
|
iotask: IoTask,
|
||||||
on_establish_cb: fn~(comm::Chan<Option<tcp_err_data>>),
|
on_establish_cb: fn~(comm::Chan<Option<tcp_err_data>>),
|
||||||
-on_connect_cb: fn~(*uv::ll::uv_tcp_t))
|
-on_connect_cb: fn~(*uv::ll::uv_tcp_t))
|
||||||
-> result::Result<(), tcp_listen_err_data> unsafe {
|
-> result::Result<(), tcp_listen_err_data> unsafe {
|
||||||
|
@ -1003,7 +1003,7 @@ type tcp_listen_fc_data = {
|
||||||
stream_closed_ch: comm::Chan<()>,
|
stream_closed_ch: comm::Chan<()>,
|
||||||
kill_ch: comm::Chan<Option<tcp_err_data>>,
|
kill_ch: comm::Chan<Option<tcp_err_data>>,
|
||||||
on_connect_cb: fn~(*uv::ll::uv_tcp_t),
|
on_connect_cb: fn~(*uv::ll::uv_tcp_t),
|
||||||
iotask: iotask,
|
iotask: IoTask,
|
||||||
mut active: bool
|
mut active: bool
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1202,7 +1202,7 @@ type tcp_socket_data = {
|
||||||
stream_handle_ptr: *uv::ll::uv_tcp_t,
|
stream_handle_ptr: *uv::ll::uv_tcp_t,
|
||||||
connect_req: uv::ll::uv_connect_t,
|
connect_req: uv::ll::uv_connect_t,
|
||||||
write_req: uv::ll::uv_write_t,
|
write_req: uv::ll::uv_write_t,
|
||||||
iotask: iotask
|
iotask: IoTask
|
||||||
};
|
};
|
||||||
|
|
||||||
type tcp_buffered_socket_data = {
|
type tcp_buffered_socket_data = {
|
||||||
|
@ -1479,7 +1479,7 @@ mod test {
|
||||||
fn run_tcp_test_server(server_ip: ~str, server_port: uint, resp: ~str,
|
fn run_tcp_test_server(server_ip: ~str, server_port: uint, resp: ~str,
|
||||||
server_ch: comm::Chan<~str>,
|
server_ch: comm::Chan<~str>,
|
||||||
cont_ch: comm::Chan<()>,
|
cont_ch: comm::Chan<()>,
|
||||||
iotask: iotask) -> ~str {
|
iotask: IoTask) -> ~str {
|
||||||
let server_ip_addr = ip::v4::parse_addr(server_ip);
|
let server_ip_addr = ip::v4::parse_addr(server_ip);
|
||||||
let listen_result = listen(server_ip_addr, server_port, 128u, iotask,
|
let listen_result = listen(server_ip_addr, server_port, 128u, iotask,
|
||||||
// on_establish_cb -- called when listener is set up
|
// on_establish_cb -- called when listener is set up
|
||||||
|
@ -1562,7 +1562,7 @@ mod test {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_tcp_test_server_fail(server_ip: ~str, server_port: uint,
|
fn run_tcp_test_server_fail(server_ip: ~str, server_port: uint,
|
||||||
iotask: iotask) -> tcp_listen_err_data {
|
iotask: IoTask) -> tcp_listen_err_data {
|
||||||
let server_ip_addr = ip::v4::parse_addr(server_ip);
|
let server_ip_addr = ip::v4::parse_addr(server_ip);
|
||||||
let listen_result = listen(server_ip_addr, server_port, 128u, iotask,
|
let listen_result = listen(server_ip_addr, server_port, 128u, iotask,
|
||||||
// on_establish_cb -- called when listener is set up
|
// on_establish_cb -- called when listener is set up
|
||||||
|
@ -1585,7 +1585,7 @@ mod test {
|
||||||
|
|
||||||
fn run_tcp_test_client(server_ip: ~str, server_port: uint, resp: ~str,
|
fn run_tcp_test_client(server_ip: ~str, server_port: uint, resp: ~str,
|
||||||
client_ch: comm::Chan<~str>,
|
client_ch: comm::Chan<~str>,
|
||||||
iotask: iotask) -> result::Result<~str,
|
iotask: IoTask) -> result::Result<~str,
|
||||||
tcp_connect_err_data> {
|
tcp_connect_err_data> {
|
||||||
let server_ip_addr = ip::v4::parse_addr(server_ip);
|
let server_ip_addr = ip::v4::parse_addr(server_ip);
|
||||||
|
|
||||||
|
|
|
@ -36,16 +36,22 @@ mod net_tcp;
|
||||||
mod net_url;
|
mod net_url;
|
||||||
|
|
||||||
// libuv modules
|
// libuv modules
|
||||||
|
#[warn(non_camel_case_types)]
|
||||||
mod uv;
|
mod uv;
|
||||||
mod uv_ll;
|
mod uv_ll;
|
||||||
|
#[warn(non_camel_case_types)]
|
||||||
mod uv_iotask;
|
mod uv_iotask;
|
||||||
|
#[warn(non_camel_case_types)]
|
||||||
mod uv_global_loop;
|
mod uv_global_loop;
|
||||||
|
|
||||||
|
|
||||||
// Utility modules
|
// Utility modules
|
||||||
|
|
||||||
|
#[warn(non_camel_case_types)]
|
||||||
mod c_vec;
|
mod c_vec;
|
||||||
|
#[warn(non_camel_case_types)]
|
||||||
mod timer;
|
mod timer;
|
||||||
|
#[warn(non_camel_case_types)]
|
||||||
mod cell;
|
mod cell;
|
||||||
|
|
||||||
// Concurrency
|
// Concurrency
|
||||||
|
@ -54,6 +60,7 @@ mod cell;
|
||||||
mod sync;
|
mod sync;
|
||||||
#[warn(non_camel_case_types)]
|
#[warn(non_camel_case_types)]
|
||||||
mod arc;
|
mod arc;
|
||||||
|
#[warn(non_camel_case_types)]
|
||||||
mod comm;
|
mod comm;
|
||||||
|
|
||||||
// Collections
|
// Collections
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import uv = uv;
|
import uv = uv;
|
||||||
import uv::iotask;
|
import uv::iotask;
|
||||||
import iotask::iotask;
|
import iotask::IoTask;
|
||||||
import comm = core::comm;
|
import comm = core::comm;
|
||||||
|
|
||||||
export delayed_send, sleep, recv_timeout;
|
export delayed_send, sleep, recv_timeout;
|
||||||
|
@ -26,7 +26,7 @@ export delayed_send, sleep, recv_timeout;
|
||||||
* * ch - a channel of type T to send a `val` on
|
* * ch - a channel of type T to send a `val` on
|
||||||
* * val - a value of type T to send over the provided `ch`
|
* * val - a value of type T to send over the provided `ch`
|
||||||
*/
|
*/
|
||||||
fn delayed_send<T: copy send>(iotask: iotask,
|
fn delayed_send<T: copy send>(iotask: IoTask,
|
||||||
msecs: uint, ch: comm::Chan<T>, +val: T) {
|
msecs: uint, ch: comm::Chan<T>, +val: T) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let timer_done_po = core::comm::Port::<()>();
|
let timer_done_po = core::comm::Port::<()>();
|
||||||
|
@ -75,7 +75,7 @@ fn delayed_send<T: copy send>(iotask: iotask,
|
||||||
* * `iotask` - a `uv::iotask` that the tcp request will run on
|
* * `iotask` - a `uv::iotask` that the tcp request will run on
|
||||||
* * msecs - an amount of time, in milliseconds, for the current task to block
|
* * msecs - an amount of time, in milliseconds, for the current task to block
|
||||||
*/
|
*/
|
||||||
fn sleep(iotask: iotask, msecs: uint) {
|
fn sleep(iotask: IoTask, msecs: uint) {
|
||||||
let exit_po = core::comm::Port::<()>();
|
let exit_po = core::comm::Port::<()>();
|
||||||
let exit_ch = core::comm::Chan(exit_po);
|
let exit_ch = core::comm::Chan(exit_po);
|
||||||
delayed_send(iotask, msecs, exit_ch, ());
|
delayed_send(iotask, msecs, exit_ch, ());
|
||||||
|
@ -102,7 +102,7 @@ fn sleep(iotask: iotask, msecs: uint) {
|
||||||
* on the provided port in the allotted timeout period, then the result will
|
* on the provided port in the allotted timeout period, then the result will
|
||||||
* be a `some(T)`. If not, then `none` will be returned.
|
* be a `some(T)`. If not, then `none` will be returned.
|
||||||
*/
|
*/
|
||||||
fn recv_timeout<T: copy send>(iotask: iotask,
|
fn recv_timeout<T: copy send>(iotask: IoTask,
|
||||||
msecs: uint,
|
msecs: uint,
|
||||||
wait_po: comm::Port<T>) -> Option<T> {
|
wait_po: comm::Port<T>) -> Option<T> {
|
||||||
let timeout_po = comm::Port::<()>();
|
let timeout_po = comm::Port::<()>();
|
||||||
|
|
|
@ -5,7 +5,7 @@ export get;
|
||||||
import ll = uv_ll;
|
import ll = uv_ll;
|
||||||
import iotask = uv_iotask;
|
import iotask = uv_iotask;
|
||||||
import get_gl = get;
|
import get_gl = get;
|
||||||
import iotask::{iotask, spawn_iotask};
|
import iotask::{IoTask, spawn_iotask};
|
||||||
import priv::{chan_from_global_ptr, weaken_task};
|
import priv::{chan_from_global_ptr, weaken_task};
|
||||||
import comm = core::comm;
|
import comm = core::comm;
|
||||||
import comm::{Port, Chan, select2, listen};
|
import comm::{Port, Chan, select2, listen};
|
||||||
|
@ -28,12 +28,12 @@ extern mod rustrt {
|
||||||
* * A `hl::high_level_loop` that encapsulates communication with the global
|
* * A `hl::high_level_loop` that encapsulates communication with the global
|
||||||
* loop.
|
* loop.
|
||||||
*/
|
*/
|
||||||
fn get() -> iotask {
|
fn get() -> IoTask {
|
||||||
return get_monitor_task_gl();
|
return get_monitor_task_gl();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
fn get_monitor_task_gl() -> iotask unsafe {
|
fn get_monitor_task_gl() -> IoTask unsafe {
|
||||||
|
|
||||||
let monitor_loop_chan_ptr = rustrt::rust_uv_get_kernel_global_chan_ptr();
|
let monitor_loop_chan_ptr = rustrt::rust_uv_get_kernel_global_chan_ptr();
|
||||||
|
|
||||||
|
@ -41,10 +41,10 @@ fn get_monitor_task_gl() -> iotask unsafe {
|
||||||
monitor_loop_chan_ptr);
|
monitor_loop_chan_ptr);
|
||||||
|
|
||||||
debug!("before priv::chan_from_global_ptr");
|
debug!("before priv::chan_from_global_ptr");
|
||||||
type monchan = Chan<iotask>;
|
type MonChan = Chan<IoTask>;
|
||||||
|
|
||||||
let monitor_ch =
|
let monitor_ch =
|
||||||
do chan_from_global_ptr::<monchan>(monitor_loop_chan_ptr,
|
do chan_from_global_ptr::<MonChan>(monitor_loop_chan_ptr,
|
||||||
|| {
|
|| {
|
||||||
task::task().sched_mode
|
task::task().sched_mode
|
||||||
(task::SingleThreaded)
|
(task::SingleThreaded)
|
||||||
|
@ -85,7 +85,7 @@ fn get_monitor_task_gl() -> iotask unsafe {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn spawn_loop() -> iotask {
|
fn spawn_loop() -> IoTask {
|
||||||
let builder = do task::task().add_wrapper |task_body| {
|
let builder = do task::task().add_wrapper |task_body| {
|
||||||
fn~(move task_body) {
|
fn~(move task_body) {
|
||||||
// The I/O loop task also needs to be weak so it doesn't keep
|
// The I/O loop task also needs to be weak so it doesn't keep
|
||||||
|
@ -131,7 +131,7 @@ mod test {
|
||||||
log(debug, ~"exiting simple timer cb");
|
log(debug, ~"exiting simple timer cb");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn impl_uv_hl_simple_timer(iotask: iotask) unsafe {
|
fn impl_uv_hl_simple_timer(iotask: IoTask) unsafe {
|
||||||
let exit_po = core::comm::Port::<bool>();
|
let exit_po = core::comm::Port::<bool>();
|
||||||
let exit_ch = core::comm::Chan(exit_po);
|
let exit_ch = core::comm::Chan(exit_po);
|
||||||
let exit_ch_ptr = ptr::addr_of(exit_ch);
|
let exit_ch_ptr = ptr::addr_of(exit_ch);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* `interact` function you can execute code in a uv callback.
|
* `interact` function you can execute code in a uv callback.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export iotask;
|
export IoTask;
|
||||||
export spawn_iotask;
|
export spawn_iotask;
|
||||||
export interact;
|
export interact;
|
||||||
export exit;
|
export exit;
|
||||||
|
@ -18,14 +18,14 @@ import task::TaskBuilder;
|
||||||
import ll = uv_ll;
|
import ll = uv_ll;
|
||||||
|
|
||||||
/// Used to abstract-away direct interaction with a libuv loop.
|
/// Used to abstract-away direct interaction with a libuv loop.
|
||||||
enum iotask {
|
enum IoTask {
|
||||||
iotask_({
|
IoTask_({
|
||||||
async_handle: *ll::uv_async_t,
|
async_handle: *ll::uv_async_t,
|
||||||
op_chan: Chan<iotask_msg>
|
op_chan: Chan<IoTaskMsg>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn spawn_iotask(-task: task::TaskBuilder) -> iotask {
|
fn spawn_iotask(-task: task::TaskBuilder) -> IoTask {
|
||||||
|
|
||||||
do listen |iotask_ch| {
|
do listen |iotask_ch| {
|
||||||
|
|
||||||
|
@ -62,9 +62,9 @@ fn spawn_iotask(-task: task::TaskBuilder) -> iotask {
|
||||||
* module. It is not safe to send the `loop_ptr` param to this callback out
|
* module. It is not safe to send the `loop_ptr` param to this callback out
|
||||||
* via ports/chans.
|
* via ports/chans.
|
||||||
*/
|
*/
|
||||||
unsafe fn interact(iotask: iotask,
|
unsafe fn interact(iotask: IoTask,
|
||||||
-cb: fn~(*c_void)) {
|
-cb: fn~(*c_void)) {
|
||||||
send_msg(iotask, interaction(cb));
|
send_msg(iotask, Interaction(cb));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,20 +74,20 @@ unsafe fn interact(iotask: iotask,
|
||||||
* async handle and do a sanity check to make sure that all other handles are
|
* async handle and do a sanity check to make sure that all other handles are
|
||||||
* closed, causing a failure otherwise.
|
* closed, causing a failure otherwise.
|
||||||
*/
|
*/
|
||||||
fn exit(iotask: iotask) unsafe {
|
fn exit(iotask: IoTask) unsafe {
|
||||||
send_msg(iotask, teardown_loop);
|
send_msg(iotask, TeardownLoop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// INTERNAL API
|
// INTERNAL API
|
||||||
|
|
||||||
enum iotask_msg {
|
enum IoTaskMsg {
|
||||||
interaction (fn~(*libc::c_void)),
|
Interaction (fn~(*libc::c_void)),
|
||||||
teardown_loop
|
TeardownLoop
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Run the loop and begin handling messages
|
/// Run the loop and begin handling messages
|
||||||
fn run_loop(iotask_ch: Chan<iotask>) unsafe {
|
fn run_loop(iotask_ch: Chan<IoTask>) unsafe {
|
||||||
|
|
||||||
let loop_ptr = ll::loop_new();
|
let loop_ptr = ll::loop_new();
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ fn run_loop(iotask_ch: Chan<iotask>) unsafe {
|
||||||
ll::async_init(loop_ptr, async_handle, wake_up_cb);
|
ll::async_init(loop_ptr, async_handle, wake_up_cb);
|
||||||
|
|
||||||
// initialize our loop data and store it in the loop
|
// initialize our loop data and store it in the loop
|
||||||
let data: iotask_loop_data = {
|
let data: IoTaskLoopData = {
|
||||||
async_handle: async_handle,
|
async_handle: async_handle,
|
||||||
msg_po: Port()
|
msg_po: Port()
|
||||||
};
|
};
|
||||||
|
@ -108,7 +108,7 @@ fn run_loop(iotask_ch: Chan<iotask>) unsafe {
|
||||||
|
|
||||||
// Send out a handle through which folks can talk to us
|
// Send out a handle through which folks can talk to us
|
||||||
// while we dwell in the I/O loop
|
// while we dwell in the I/O loop
|
||||||
let iotask = iotask_({
|
let iotask = IoTask_({
|
||||||
async_handle: async_handle,
|
async_handle: async_handle,
|
||||||
op_chan: data.msg_po.chan()
|
op_chan: data.msg_po.chan()
|
||||||
});
|
});
|
||||||
|
@ -122,13 +122,13 @@ fn run_loop(iotask_ch: Chan<iotask>) unsafe {
|
||||||
}
|
}
|
||||||
|
|
||||||
// data that lives for the lifetime of the high-evel oo
|
// data that lives for the lifetime of the high-evel oo
|
||||||
type iotask_loop_data = {
|
type IoTaskLoopData = {
|
||||||
async_handle: *ll::uv_async_t,
|
async_handle: *ll::uv_async_t,
|
||||||
msg_po: Port<iotask_msg>
|
msg_po: Port<IoTaskMsg>
|
||||||
};
|
};
|
||||||
|
|
||||||
fn send_msg(iotask: iotask,
|
fn send_msg(iotask: IoTask,
|
||||||
-msg: iotask_msg) unsafe {
|
-msg: IoTaskMsg) unsafe {
|
||||||
iotask.op_chan.send(msg);
|
iotask.op_chan.send(msg);
|
||||||
ll::async_send(iotask.async_handle);
|
ll::async_send(iotask.async_handle);
|
||||||
}
|
}
|
||||||
|
@ -141,18 +141,18 @@ extern fn wake_up_cb(async_handle: *ll::uv_async_t,
|
||||||
async_handle, status));
|
async_handle, status));
|
||||||
|
|
||||||
let loop_ptr = ll::get_loop_for_uv_handle(async_handle);
|
let loop_ptr = ll::get_loop_for_uv_handle(async_handle);
|
||||||
let data = ll::get_data_for_uv_handle(async_handle) as *iotask_loop_data;
|
let data = ll::get_data_for_uv_handle(async_handle) as *IoTaskLoopData;
|
||||||
let msg_po = (*data).msg_po;
|
let msg_po = (*data).msg_po;
|
||||||
|
|
||||||
while msg_po.peek() {
|
while msg_po.peek() {
|
||||||
match msg_po.recv() {
|
match msg_po.recv() {
|
||||||
interaction(cb) => cb(loop_ptr),
|
Interaction(cb) => cb(loop_ptr),
|
||||||
teardown_loop => begin_teardown(data)
|
TeardownLoop => begin_teardown(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn begin_teardown(data: *iotask_loop_data) unsafe {
|
fn begin_teardown(data: *IoTaskLoopData) unsafe {
|
||||||
log(debug, ~"iotask begin_teardown() called, close async_handle");
|
log(debug, ~"iotask begin_teardown() called, close async_handle");
|
||||||
let async_handle = (*data).async_handle;
|
let async_handle = (*data).async_handle;
|
||||||
ll::close(async_handle as *c_void, tear_down_close_cb);
|
ll::close(async_handle as *c_void, tear_down_close_cb);
|
||||||
|
@ -171,7 +171,7 @@ mod test {
|
||||||
extern fn async_close_cb(handle: *ll::uv_async_t) unsafe {
|
extern fn async_close_cb(handle: *ll::uv_async_t) unsafe {
|
||||||
log(debug, fmt!("async_close_cb handle %?", handle));
|
log(debug, fmt!("async_close_cb handle %?", handle));
|
||||||
let exit_ch = (*(ll::get_data_for_uv_handle(handle)
|
let exit_ch = (*(ll::get_data_for_uv_handle(handle)
|
||||||
as *ah_data)).exit_ch;
|
as *AhData)).exit_ch;
|
||||||
core::comm::send(exit_ch, ());
|
core::comm::send(exit_ch, ());
|
||||||
}
|
}
|
||||||
extern fn async_handle_cb(handle: *ll::uv_async_t, status: libc::c_int)
|
extern fn async_handle_cb(handle: *ll::uv_async_t, status: libc::c_int)
|
||||||
|
@ -179,11 +179,11 @@ mod test {
|
||||||
log(debug, fmt!("async_handle_cb handle %? status %?",handle,status));
|
log(debug, fmt!("async_handle_cb handle %? status %?",handle,status));
|
||||||
ll::close(handle, async_close_cb);
|
ll::close(handle, async_close_cb);
|
||||||
}
|
}
|
||||||
type ah_data = {
|
type AhData = {
|
||||||
iotask: iotask,
|
iotask: IoTask,
|
||||||
exit_ch: comm::Chan<()>
|
exit_ch: comm::Chan<()>
|
||||||
};
|
};
|
||||||
fn impl_uv_iotask_async(iotask: iotask) unsafe {
|
fn impl_uv_iotask_async(iotask: IoTask) unsafe {
|
||||||
let async_handle = ll::async_t();
|
let async_handle = ll::async_t();
|
||||||
let ah_ptr = ptr::addr_of(async_handle);
|
let ah_ptr = ptr::addr_of(async_handle);
|
||||||
let exit_po = core::comm::Port::<()>();
|
let exit_po = core::comm::Port::<()>();
|
||||||
|
@ -203,8 +203,8 @@ mod test {
|
||||||
|
|
||||||
// this fn documents the bear minimum neccesary to roll your own
|
// this fn documents the bear minimum neccesary to roll your own
|
||||||
// high_level_loop
|
// high_level_loop
|
||||||
unsafe fn spawn_test_loop(exit_ch: comm::Chan<()>) -> iotask {
|
unsafe fn spawn_test_loop(exit_ch: comm::Chan<()>) -> IoTask {
|
||||||
let iotask_port = comm::Port::<iotask>();
|
let iotask_port = comm::Port::<IoTask>();
|
||||||
let iotask_ch = comm::Chan(iotask_port);
|
let iotask_ch = comm::Chan(iotask_port);
|
||||||
do task::spawn_sched(task::ManualThreads(1u)) {
|
do task::spawn_sched(task::ManualThreads(1u)) {
|
||||||
run_loop(iotask_ch);
|
run_loop(iotask_ch);
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* with per-platform, generated source files from rust-bindgen.
|
* with per-platform, generated source files from rust-bindgen.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)] // C types
|
||||||
|
|
||||||
import libc::size_t;
|
import libc::size_t;
|
||||||
import comm = core::comm;
|
import comm = core::comm;
|
||||||
import ptr::to_unsafe_ptr;
|
import ptr::to_unsafe_ptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue