Skip to content

Commit 11b7573

Browse files
committed
---
yaml --- r: 96917 b: refs/heads/dist-snap c: 51abdee h: refs/heads/master i: 96915: a50fd6e v: v3
1 parent a93e585 commit 11b7573

File tree

29 files changed

+1696
-2041
lines changed

29 files changed

+1696
-2041
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 6aadc9d18856f8e7ea8038e2c4b2ba0f9507e26a
9+
refs/heads/dist-snap: 51abdee5f1ad932671350fdd8a7911fe144d08b8
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/task_pool.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
/// parallelism.
1515
1616

17-
use std::task::SchedMode;
1817
use std::task;
1918
use std::vec;
2019

@@ -46,7 +45,6 @@ impl<T> TaskPool<T> {
4645
/// returns a function which, given the index of the task, should return
4746
/// local data to be kept around in that task.
4847
pub fn new(n_tasks: uint,
49-
opt_sched_mode: Option<SchedMode>,
5048
init_fn_factory: || -> proc(uint) -> T)
5149
-> TaskPool<T> {
5250
assert!(n_tasks >= 1);
@@ -65,18 +63,8 @@ impl<T> TaskPool<T> {
6563
}
6664
};
6765

68-
// Start the task.
69-
match opt_sched_mode {
70-
None => {
71-
// Run on this scheduler.
72-
task::spawn(task_body);
73-
}
74-
Some(sched_mode) => {
75-
let mut task = task::task();
76-
task.sched_mode(sched_mode);
77-
task.spawn(task_body);
78-
}
79-
}
66+
// Run on this scheduler.
67+
task::spawn(task_body);
8068

8169
chan
8270
});
@@ -99,7 +87,7 @@ fn test_task_pool() {
9987
let g: proc(uint) -> uint = proc(i) i;
10088
g
10189
};
102-
let mut pool = TaskPool::new(4, Some(SingleThreaded), f);
90+
let mut pool = TaskPool::new(4, f);
10391
8.times(|| {
10492
pool.execute(proc(i) println!("Hello from thread {}!", *i));
10593
})

branches/dist-snap/src/libstd/rt/basic.rs renamed to branches/dist-snap/src/libgreen/basic.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
//! This is a basic event loop implementation not meant for any "real purposes"
1212
//! other than testing the scheduler and proving that it's possible to have a
1313
//! pluggable event loop.
14+
//!
15+
//! This implementation is also used as the fallback implementation of an event
16+
//! loop if no other one is provided (and M:N scheduling is desired).
1417
15-
use prelude::*;
16-
17-
use cast;
18-
use rt::rtio::{EventLoop, IoFactory, RemoteCallback, PausableIdleCallback,
19-
Callback};
20-
use unstable::sync::Exclusive;
21-
use io::native;
22-
use util;
18+
use std::cast;
19+
use std::rt::rtio::{EventLoop, IoFactory, RemoteCallback, PausibleIdleCallback,
20+
Callback};
21+
use std::unstable::sync::Exclusive;
22+
use std::util;
2323

2424
/// This is the only exported function from this module.
2525
pub fn event_loop() -> ~EventLoop {
@@ -32,7 +32,6 @@ struct BasicLoop {
3232
remotes: ~[(uint, ~Callback)],
3333
next_remote: uint,
3434
messages: Exclusive<~[Message]>,
35-
io: ~IoFactory,
3635
}
3736

3837
enum Message { RunRemote(uint), RemoveRemote(uint) }
@@ -45,7 +44,6 @@ impl BasicLoop {
4544
next_remote: 0,
4645
remotes: ~[],
4746
messages: Exclusive::new(~[]),
48-
io: ~native::IoFactory as ~IoFactory,
4947
}
5048
}
5149

@@ -159,10 +157,7 @@ impl EventLoop for BasicLoop {
159157
~BasicRemote::new(self.messages.clone(), id) as ~RemoteCallback
160158
}
161159

162-
fn io<'a>(&'a mut self) -> Option<&'a mut IoFactory> {
163-
let factory: &mut IoFactory = self.io;
164-
Some(factory)
165-
}
160+
fn io<'a>(&'a mut self) -> Option<&'a mut IoFactory> { None }
166161
}
167162

168163
struct BasicRemote {

0 commit comments

Comments
 (0)