Skip to content
Newer
Older
100644 23 lines (20 sloc) 433 Bytes
ebc61e3 @brson Remove temporary fn# syntax
brson authored
1 fn f(&&n: uint) {
dc07280 @nikomatsakis make --enforce-mut-vars always on, add mut annotations to remaining f…
nikomatsakis authored
2 let mut i = 0u;
15e456d @brson Convert task-perf-spawnalot to spawn_joinable. XFAIL
brson authored
3 while i < n {
d1fc2b5 @brson Convert to new closure syntax
brson authored
4 task::try(|| g() );
5c49e4f @brson Reformat. Issue #855
brson authored
5 i += 1u;
6 }
ec46f07 @brson Add a task spawning benchmark
brson authored
7 }
8
d4410a9 @nikomatsakis rewrite to use old C++-based mechanism
nikomatsakis authored
9 fn g() { }
ec46f07 @brson Add a task spawning benchmark
brson authored
10
267ab11 @nikomatsakis use + mode for (almost) everything when not using legacy modes
nikomatsakis authored
11 fn main(++args: ~[~str]) {
92743dc @msullivan Move the world over to using the new style string literals and types.…
msullivan authored
12 let args = if os::getenv(~"RUST_BENCH").is_some() {
13 ~[~"", ~"400"]
4fec4cd @brson bench: Add hard mode to benchmarks. Activate with RUST_BENCH.
brson authored
14 } else if args.len() <= 1u {
92743dc @msullivan Move the world over to using the new style string literals and types.…
msullivan authored
15 ~[~"", ~"10"]
4fec4cd @brson bench: Add hard mode to benchmarks. Activate with RUST_BENCH.
brson authored
16 } else {
17 args
18 };
19 let n = uint::from_str(args[1]).get();
dc07280 @nikomatsakis make --enforce-mut-vars always on, add mut annotations to remaining f…
nikomatsakis authored
20 let mut i = 0u;
d1fc2b5 @brson Convert to new closure syntax
brson authored
21 while i < n { task::spawn(|| f(n) ); i += 1u; }
5c67905 Reducing the chances for race conditions in join.
Eric Holk authored
22 }
Something went wrong with that request. Please try again.