diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-11 15:34:35 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-11 16:11:31 -0800 |
| commit | 3d9023fa4ddc8dbb5d9be0e4e4ef5c284c6b077a (patch) | |
| tree | ff4ed0e61a85f4f11e4b094fac90d488462403bf /src/test | |
| parent | 07771ec25bc394a4a053252a2b5441f3160a0568 (diff) | |
rt: Take the task lock when dropping port refcounts
Sucks, but otherwise there are races when one task drops the refcount to zero followed by another bumping it again
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/task-comm-15.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/run-pass/task-comm-15.rs b/src/test/run-pass/task-comm-15.rs index 2876441673c..69b11519d28 100644 --- a/src/test/run-pass/task-comm-15.rs +++ b/src/test/run-pass/task-comm-15.rs @@ -1,11 +1,10 @@ -// xfail-test // xfail-win32 use std; import std::comm; import std::task; -fn start(c: comm::chan<int>, n: int) { - let i: int = n; +fn start(&&args: (comm::chan<int>, int)) { + let (c, i) = args; while i > 0 { comm::send(c, 0); i = i - 1; } } @@ -16,6 +15,6 @@ fn main() { // is likely to terminate before the child completes, so from // the child's point of view the receiver may die. We should // drop messages on the floor in this case, and not crash! - let child = task::spawn(bind start(comm::chan(p), 10)); + let child = task::spawn((comm::chan(p), 10), start); let c = comm::recv(p); } |
