#[deny(unused_imports)];
#[deny(unused_mut)];
#[deny(unused_variable)];
+#[deny(unused_unsafe)];
use cell::Cell;
use clone::Clone;
let nthreads = match os::getenv("RUST_THREADS") {
Some(nstr) => FromStr::from_str(nstr).get(),
- None => unsafe { util::num_cpus() }
+ None => util::num_cpus()
};
// The shared list of sleeping schedulers. Schedulers wake each other
do run_in_bare_thread {
let nthreads = match os::getenv("RUST_TEST_THREADS") {
Some(nstr) => FromStr::from_str(nstr).get(),
- None => unsafe {
+ None => {
// Using more threads than cores in test code
// to force the OS to preempt them frequently.
// Assuming that this help stress test concurrent types.
let mut timer2 = TimerWatcher::new(&mut loop_);
do timer2.start(10, 0) |timer2, _| {
- unsafe { *count_ptr += 1; }
+ *count_ptr += 1;
timer2.close(||());
// Restart the original timer
let mut timer = timer;
do timer.start(1, 0) |timer, _| {
- unsafe { *count_ptr += 1; }
+ *count_ptr += 1;
timer.close(||());
}
}