Skip to content

Commit c5e880d

Browse files
committed
---
yaml --- r: 64880 b: refs/heads/snap-stage3 c: 5ec1d5b h: refs/heads/master v: v3
1 parent b0ab78a commit c5e880d

File tree

19 files changed

+207
-77
lines changed

19 files changed

+207
-77
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 81dda9d9cb5a8e472509c6f335acc81083d74b91
4+
refs/heads/snap-stage3: 5ec1d5b69d8eb81b9b9f4381e9e4b8bbea6e6a5e
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libextra/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ mod tests {
890890
fn test_sem_runtime_friendly_blocking() {
891891
// Force the runtime to schedule two threads on the same sched_loop.
892892
// When one blocks, it should schedule the other one.
893-
do task::spawn_sched(task::SingleThreaded) {
893+
do task::spawn_sched(task::ManualThreads(1)) {
894894
let s = ~Semaphore::new(1);
895895
let s2 = ~s.clone();
896896
let (p,c) = comm::stream();

branches/snap-stage3/src/libextra/unicode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub mod icu {
1717
pub type UChar32 = char;
1818

1919
pub static TRUE : u8 = 1u8;
20-
pub static FALSE : u8 = 1u8;
20+
pub static FALSE : u8 = 0u8;
2121

2222
pub static UCHAR_ALPHABETIC : UProperty = 0;
2323
pub static UCHAR_BINARY_START : UProperty = 0; // = UCHAR_ALPHABETIC

branches/snap-stage3/src/libstd/rt/comm.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -674,11 +674,10 @@ mod test {
674674
do run_in_newsched_task {
675675
let (port, chan) = oneshot::<int>();
676676
let port_cell = Cell::new(port);
677-
let thread = do spawntask_thread {
677+
let _thread = do spawntask_thread {
678678
let _p = port_cell.take();
679679
};
680680
let _chan = chan;
681-
thread.join();
682681
}
683682
}
684683
}
@@ -690,15 +689,13 @@ mod test {
690689
let (port, chan) = oneshot::<int>();
691690
let chan_cell = Cell::new(chan);
692691
let port_cell = Cell::new(port);
693-
let thread1 = do spawntask_thread {
692+
let _thread1 = do spawntask_thread {
694693
let _p = port_cell.take();
695694
};
696-
let thread2 = do spawntask_thread {
695+
let _thread2 = do spawntask_thread {
697696
let c = chan_cell.take();
698697
c.send(1);
699698
};
700-
thread1.join();
701-
thread2.join();
702699
}
703700
}
704701
}
@@ -710,21 +707,19 @@ mod test {
710707
let (port, chan) = oneshot::<int>();
711708
let chan_cell = Cell::new(chan);
712709
let port_cell = Cell::new(port);
713-
let thread1 = do spawntask_thread {
710+
let _thread1 = do spawntask_thread {
714711
let port_cell = Cell::new(port_cell.take());
715712
let res = do spawntask_try {
716713
port_cell.take().recv();
717714
};
718715
assert!(res.is_err());
719716
};
720-
let thread2 = do spawntask_thread {
717+
let _thread2 = do spawntask_thread {
721718
let chan_cell = Cell::new(chan_cell.take());
722719
do spawntask {
723720
chan_cell.take();
724721
}
725722
};
726-
thread1.join();
727-
thread2.join();
728723
}
729724
}
730725
}
@@ -736,14 +731,12 @@ mod test {
736731
let (port, chan) = oneshot::<~int>();
737732
let chan_cell = Cell::new(chan);
738733
let port_cell = Cell::new(port);
739-
let thread1 = do spawntask_thread {
734+
let _thread1 = do spawntask_thread {
740735
chan_cell.take().send(~10);
741736
};
742-
let thread2 = do spawntask_thread {
737+
let _thread2 = do spawntask_thread {
743738
assert!(port_cell.take().recv() == ~10);
744739
};
745-
thread1.join();
746-
thread2.join();
747740
}
748741
}
749742
}

branches/snap-stage3/src/libstd/rt/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,7 @@ fn run_(main: ~fn(), use_main_sched: bool) -> int {
343343
}
344344

345345
// Wait for schedulers
346-
for threads.consume_iter().advance() |thread| {
347-
thread.join();
348-
}
346+
{ let _threads = threads; }
349347

350348
// Return the exit code
351349
unsafe {

branches/snap-stage3/src/libstd/rt/sched.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,10 @@ mod test {
901901
sched.run();
902902
};
903903

904-
normal_thread.join();
905-
special_thread.join();
904+
// wait for the end
905+
let _thread1 = normal_thread;
906+
let _thread2 = special_thread;
907+
906908
}
907909
}
908910

@@ -1072,19 +1074,16 @@ mod test {
10721074
sched2.enqueue_task(task2);
10731075

10741076
let sched1_cell = Cell::new(sched1);
1075-
let thread1 = do Thread::start {
1077+
let _thread1 = do Thread::start {
10761078
let sched1 = sched1_cell.take();
10771079
sched1.run();
10781080
};
10791081

10801082
let sched2_cell = Cell::new(sched2);
1081-
let thread2 = do Thread::start {
1083+
let _thread2 = do Thread::start {
10821084
let sched2 = sched2_cell.take();
10831085
sched2.run();
10841086
};
1085-
1086-
thread1.join();
1087-
thread2.join();
10881087
}
10891088
}
10901089

branches/snap-stage3/src/libstd/rt/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl Drop for Task {
219219
impl Coroutine {
220220

221221
pub fn new(stack_pool: &mut StackPool, start: ~fn()) -> Coroutine {
222-
static MIN_STACK_SIZE: uint = 2000000; // XXX: Too much stack
222+
static MIN_STACK_SIZE: uint = 100000; // XXX: Too much stack
223223

224224
let start = Coroutine::build_start_wrapper(start);
225225
let mut stack = stack_pool.take_segment(MIN_STACK_SIZE);

branches/snap-stage3/src/libstd/rt/test.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ pub fn run_in_mt_newsched_task(f: ~fn()) {
125125
}
126126

127127
// Wait for schedulers
128-
for threads.consume_iter().advance() |thread| {
129-
thread.join();
130-
}
128+
let _threads = threads;
131129
}
132130

133131
}

branches/snap-stage3/src/libstd/rt/thread.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ type raw_thread = libc::c_void;
1616

1717
pub struct Thread {
1818
main: ~fn(),
19-
raw_thread: *raw_thread,
20-
joined: bool
19+
raw_thread: *raw_thread
2120
}
2221

2322
impl Thread {
@@ -28,28 +27,18 @@ impl Thread {
2827
let raw = substart(&main);
2928
Thread {
3029
main: main,
31-
raw_thread: raw,
32-
joined: false
30+
raw_thread: raw
3331
}
3432
}
35-
36-
pub fn join(self) {
37-
assert!(!self.joined);
38-
let mut this = self;
39-
unsafe { rust_raw_thread_join(this.raw_thread); }
40-
this.joined = true;
41-
}
4233
}
4334

4435
impl Drop for Thread {
4536
fn drop(&self) {
46-
assert!(self.joined);
47-
unsafe { rust_raw_thread_delete(self.raw_thread) }
37+
unsafe { rust_raw_thread_join_delete(self.raw_thread) }
4838
}
4939
}
5040

5141
extern {
5242
pub unsafe fn rust_raw_thread_start(f: &(~fn())) -> *raw_thread;
53-
pub unsafe fn rust_raw_thread_join(thread: *raw_thread);
54-
pub unsafe fn rust_raw_thread_delete(thread: *raw_thread);
43+
pub unsafe fn rust_raw_thread_join_delete(thread: *raw_thread);
5544
}

branches/snap-stage3/src/libstd/rt/uv/async.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,12 @@ mod test {
9494
let mut loop_ = Loop::new();
9595
let watcher = AsyncWatcher::new(&mut loop_, |w, _| w.close(||()) );
9696
let watcher_cell = Cell::new(watcher);
97-
let thread = do Thread::start {
97+
let _thread = do Thread::start {
9898
let mut watcher = watcher_cell.take();
9999
watcher.send();
100100
};
101101
loop_.run();
102102
loop_.close();
103-
thread.join();
104103
}
105104
}
106105
}

branches/snap-stage3/src/libstd/rt/uv/net.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ mod test {
715715
}
716716
}
717717
718-
let client_thread = do Thread::start {
718+
let _client_thread = do Thread::start {
719719
rtdebug!("starting client thread");
720720
let mut loop_ = Loop::new();
721721
let mut tcp_watcher = { TcpWatcher::new(&mut loop_) };
@@ -739,7 +739,6 @@ mod test {
739739
let mut loop_ = loop_;
740740
loop_.run();
741741
loop_.close();
742-
client_thread.join();
743742
}
744743
}
745744
@@ -791,7 +790,7 @@ mod test {
791790
}
792791
}
793792
794-
let client_thread = do Thread::start {
793+
let _client_thread = do Thread::start {
795794
rtdebug!("starting client thread");
796795
let mut loop_ = Loop::new();
797796
let mut tcp_watcher = { TcpWatcher::new(&mut loop_) };
@@ -815,7 +814,6 @@ mod test {
815814
let mut loop_ = loop_;
816815
loop_.run();
817816
loop_.close();
818-
client_thread.join();
819817
}
820818
}
821819
@@ -857,7 +855,7 @@ mod test {
857855
server.close(||{});
858856
}
859857
860-
let thread = do Thread::start {
858+
do Thread::start {
861859
let mut loop_ = Loop::new();
862860
let mut client = UdpWatcher::new(&loop_);
863861
assert!(client.bind(client_addr).is_ok());
@@ -875,7 +873,6 @@ mod test {
875873
876874
loop_.run();
877875
loop_.close();
878-
thread.join();
879876
}
880877
}
881878
@@ -917,7 +914,7 @@ mod test {
917914
server.close(||{});
918915
}
919916
920-
let thread = do Thread::start {
917+
do Thread::start {
921918
let mut loop_ = Loop::new();
922919
let mut client = UdpWatcher::new(&loop_);
923920
assert!(client.bind(client_addr).is_ok());
@@ -935,7 +932,6 @@ mod test {
935932

936933
loop_.run();
937934
loop_.close();
938-
thread.join();
939935
}
940936
}
941937
}

branches/snap-stage3/src/libstd/rt/uv/uvio.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,11 @@ mod test_remote {
222222
};
223223
remote_cell.put_back(remote);
224224
}
225-
let thread = do Thread::start {
225+
let _thread = do Thread::start {
226226
remote_cell.take().fire();
227227
};
228228

229229
assert!(tube.recv() == 1);
230-
thread.join();
231230
}
232231
}
233232
}

0 commit comments

Comments
 (0)