Skip to content

Commit dd35a7b

Browse files
committed
---
yaml --- r: 151896 b: refs/heads/try2 c: 4c8a4d2 h: refs/heads/master v: v3
1 parent bad4195 commit dd35a7b

File tree

7 files changed

+24
-219
lines changed

7 files changed

+24
-219
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 73729e94c87281dd7193dbdc86b4de2963b8fd72
8+
refs/heads/try2: 4c8a4d241a984fdc0b8a015dceca2a006f2b7146
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/sync/arc.rs

Lines changed: 0 additions & 189 deletions
This file was deleted.

branches/try2/src/libstd/sync/deque.rs

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ mod tests {
417417

418418
#[test]
419419
fn smoke() {
420-
let mut pool = BufferPool::new();
421-
let (mut w, mut s) = pool.deque();
420+
let pool = BufferPool::new();
421+
let (w, s) = pool.deque();
422422
assert_eq!(w.pop(), None);
423423
assert_eq!(s.steal(), Empty);
424424
w.push(1);
@@ -432,10 +432,9 @@ mod tests {
432432
#[test]
433433
fn stealpush() {
434434
static AMT: int = 100000;
435-
let mut pool = BufferPool::<int>::new();
436-
let (mut w, s) = pool.deque();
435+
let pool = BufferPool::<int>::new();
436+
let (w, s) = pool.deque();
437437
let t = Thread::start(proc() {
438-
let mut s = s;
439438
let mut left = AMT;
440439
while left > 0 {
441440
match s.steal() {
@@ -458,10 +457,9 @@ mod tests {
458457
#[test]
459458
fn stealpush_large() {
460459
static AMT: int = 100000;
461-
let mut pool = BufferPool::<(int, int)>::new();
462-
let (mut w, s) = pool.deque();
460+
let pool = BufferPool::<(int, int)>::new();
461+
let (w, s) = pool.deque();
463462
let t = Thread::start(proc() {
464-
let mut s = s;
465463
let mut left = AMT;
466464
while left > 0 {
467465
match s.steal() {
@@ -479,7 +477,7 @@ mod tests {
479477
t.join();
480478
}
481479

482-
fn stampede(mut w: Worker<Box<int>>, s: Stealer<Box<int>>,
480+
fn stampede(w: Worker<Box<int>>, s: Stealer<Box<int>>,
483481
nthreads: int, amt: uint) {
484482
for _ in range(0, amt) {
485483
w.push(box 20);
@@ -491,7 +489,6 @@ mod tests {
491489
let s = s.clone();
492490
Thread::start(proc() {
493491
unsafe {
494-
let mut s = s;
495492
while (*unsafe_remaining).load(SeqCst) > 0 {
496493
match s.steal() {
497494
Data(box 20) => {
@@ -520,15 +517,15 @@ mod tests {
520517

521518
#[test]
522519
fn run_stampede() {
523-
let mut pool = BufferPool::<Box<int>>::new();
520+
let pool = BufferPool::<Box<int>>::new();
524521
let (w, s) = pool.deque();
525522
stampede(w, s, 8, 10000);
526523
}
527524

528525
#[test]
529526
fn many_stampede() {
530527
static AMT: uint = 4;
531-
let mut pool = BufferPool::<Box<int>>::new();
528+
let pool = BufferPool::<Box<int>>::new();
532529
let threads = range(0, AMT).map(|_| {
533530
let (w, s) = pool.deque();
534531
Thread::start(proc() {
@@ -547,14 +544,13 @@ mod tests {
547544
static NTHREADS: int = 8;
548545
static mut DONE: AtomicBool = INIT_ATOMIC_BOOL;
549546
static mut HITS: AtomicUint = INIT_ATOMIC_UINT;
550-
let mut pool = BufferPool::<int>::new();
551-
let (mut w, s) = pool.deque();
547+
let pool = BufferPool::<int>::new();
548+
let (w, s) = pool.deque();
552549

553550
let threads = range(0, NTHREADS).map(|_| {
554551
let s = s.clone();
555552
Thread::start(proc() {
556553
unsafe {
557-
let mut s = s;
558554
loop {
559555
match s.steal() {
560556
Data(2) => { HITS.fetch_add(1, SeqCst); }
@@ -606,8 +602,8 @@ mod tests {
606602
static AMT: int = 10000;
607603
static NTHREADS: int = 4;
608604
static mut DONE: AtomicBool = INIT_ATOMIC_BOOL;
609-
let mut pool = BufferPool::<(int, uint)>::new();
610-
let (mut w, s) = pool.deque();
605+
let pool = BufferPool::<(int, uint)>::new();
606+
let (w, s) = pool.deque();
611607

612608
let (threads, hits) = vec::unzip(range(0, NTHREADS).map(|_| {
613609
let s = s.clone();
@@ -617,7 +613,6 @@ mod tests {
617613
};
618614
(Thread::start(proc() {
619615
unsafe {
620-
let mut s = s;
621616
loop {
622617
match s.steal() {
623618
Data((1, 2)) => {

branches/try2/src/libstd/sync/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//! and/or blocking at all, but rather provide the necessary tools to build
1616
//! other types of concurrent primitives.
1717
18-
pub mod arc;
1918
pub mod atomics;
2019
pub mod deque;
2120
pub mod mpmc_bounded_queue;

branches/try2/src/libstd/sync/mpmc_bounded_queue.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ mod tests {
173173
fn test() {
174174
let nthreads = 8u;
175175
let nmsgs = 1000u;
176-
let mut q = Queue::with_capacity(nthreads*nmsgs);
176+
let q = Queue::with_capacity(nthreads*nmsgs);
177177
assert_eq!(None, q.pop());
178178
let (tx, rx) = channel();
179179

180180
for _ in range(0, nthreads) {
181181
let q = q.clone();
182182
let tx = tx.clone();
183183
native::task::spawn(proc() {
184-
let mut q = q;
184+
let q = q;
185185
for i in range(0, nmsgs) {
186186
assert!(q.push(i));
187187
}
@@ -195,7 +195,7 @@ mod tests {
195195
completion_rxs.push(rx);
196196
let q = q.clone();
197197
native::task::spawn(proc() {
198-
let mut q = q;
198+
let q = q;
199199
let mut i = 0u;
200200
loop {
201201
match q.pop() {

branches/try2/src/libstd/sync/mpsc_queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ mod tests {
165165

166166
#[test]
167167
fn test_full() {
168-
let mut q = Queue::new();
168+
let q = Queue::new();
169169
q.push(box 1);
170170
q.push(box 2);
171171
}
@@ -174,7 +174,7 @@ mod tests {
174174
fn test() {
175175
let nthreads = 8u;
176176
let nmsgs = 1000u;
177-
let mut q = Queue::new();
177+
let q = Queue::new();
178178
match q.pop() {
179179
Empty => {}
180180
Inconsistent | Data(..) => fail!()

0 commit comments

Comments
 (0)