]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #10058 : alexcrichton/rust/uv-crate, r=brson
authorbors <bors@rust-lang.org>
Tue, 29 Oct 2013 16:36:47 +0000 (09:36 -0700)
committerbors <bors@rust-lang.org>
Tue, 29 Oct 2013 16:36:47 +0000 (09:36 -0700)
This is one of the final steps needed to complete #9128. It still needs a little bit of polish before closing that issue, but it's in a pretty much "done" state now.

The idea here is that the entire event loop implementation using libuv is now housed in `librustuv` as a completely separate library. This library is then injected (via `extern mod rustv`) into executable builds (similarly to how libstd is injected, tunable via `#[no_uv]`) to bring in the "rust blessed event loop implementation."

Codegen-wise, there is a new `event_loop_factory` language item which is tagged on a function with 0 arguments returning `~EventLoop`. This function's symbol is then inserted into the crate map for an executable crate, and if there is no definition of the `event_loop_factory` language item then the value is null.

What this means is that embedding rust as a library in another language just got a little harder. Libraries don't have crate maps, which means that there's no way to find the event loop implementation to spin up the runtime. That being said, it's always possible to build the runtime manually. This request also makes more runtime components public which should probably be public anyway. This new public-ness should allow custom scheduler setups everywhere regardless of whether you follow the `rt::start `path.

1  2 
src/librustc/middle/trans/base.rs
src/libstd/rt/sched.rs
src/libstd/rt/uv/uvio.rs

Simple merge
index 93056314b141d4fc5ca4c87491e49718a0490d50,4b0333634024b52df4efca81f71972e84d051bfc..fd4dab60ff36fa57a803f2fb3af2f375e5622c74
@@@ -527,9 -540,9 +527,9 @@@ impl Scheduler 
          // We've made work available. Notify a
          // sleeping scheduler.
  
 -        match this.sleeper_list.casual_pop() {
 +        match self.sleeper_list.casual_pop() {
              Some(handle) => {
-                         let mut handle = handle;
+                 let mut handle = handle;
                  handle.send(Wake)
              }
              None => { (/* pass */) }
Simple merge