File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ use std::os;
26
26
use std:: str;
27
27
use std:: task:: { spawn_sched, SingleThreaded } ;
28
28
use std:: vec;
29
+ use std:: unstable:: running_on_valgrind;
29
30
30
31
use extra:: test:: MetricMap ;
31
32
@@ -38,11 +39,21 @@ pub fn run(config: config, testfile: ~str) {
38
39
// that destroys parallelism if we let normal schedulers block.
39
40
// It should be possible to remove this spawn once std::run is
40
41
// rewritten to be non-blocking.
41
- do spawn_sched ( SingleThreaded ) {
42
+ //
43
+ // We do _not_ create another thread if we're running on V because
44
+ // it serializes all threads anyways.
45
+ if running_on_valgrind ( ) {
42
46
let config = config. take ( ) ;
43
47
let testfile = testfile. take ( ) ;
44
48
let mut _mm = MetricMap :: new ( ) ;
45
49
run_metrics ( config, testfile, & mut _mm) ;
50
+ } else {
51
+ do spawn_sched ( SingleThreaded ) {
52
+ let config = config. take ( ) ;
53
+ let testfile = testfile. take ( ) ;
54
+ let mut _mm = MetricMap :: new ( ) ;
55
+ run_metrics ( config, testfile, & mut _mm) ;
56
+ }
46
57
}
47
58
}
48
59
You can’t perform that action at this time.
0 commit comments