diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-08-17 11:44:35 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-08-17 11:44:50 -0700 |
| commit | 94260fb91d3e8a11f39eafc1c21bc974713db166 (patch) | |
| tree | f30b13600c03592562086b75135d036907f712e9 /src/lib/test.rs | |
| parent | 1d7ca9c1897260c30ba236652c2043e670577fe4 (diff) | |
| download | rust-94260fb91d3e8a11f39eafc1c21bc974713db166.tar.gz rust-94260fb91d3e8a11f39eafc1c21bc974713db166.zip | |
Using move-mode for spawn thunks to avoid race conditions.
Diffstat (limited to 'src/lib/test.rs')
| -rw-r--r-- | src/lib/test.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/test.rs b/src/lib/test.rs index 5b6d6b34c97..2b4d1f2714a 100644 --- a/src/lib/test.rs +++ b/src/lib/test.rs @@ -336,13 +336,16 @@ fn run_test(test: &test_desc, to_task: &test_to_task) -> test_future { // we've got to treat our test functions as unsafe pointers. This function // only works with functions that don't contain closures. fn default_test_to_task(f: &fn()) -> task_id { + /* fn run_task(fptr: *mutable fn() ) { configure_test_task(); // Run the test (*fptr)() } let fptr = ptr::addr_of(f); - ret task::_spawn(bind run_task(fptr)); + */ + //ret task::_spawn(bind run_task(fptr)); + task::spawn(f) } // Call from within a test task to make sure it's set up correctly |
