diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-07-25 23:18:31 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-07-26 11:12:20 -0700 |
| commit | f110c206097e9483cbe68be50eca80ac63abcbbd (patch) | |
| tree | 608543cd9141a042c45ce5e463ff3c11b5d6fa96 /src | |
| parent | 067cb6d53751b2c93d3e1ea45e7547069f865e6a (diff) | |
| download | rust-f110c206097e9483cbe68be50eca80ac63abcbbd.tar.gz rust-f110c206097e9483cbe68be50eca80ac63abcbbd.zip | |
Join the process server after running all compile tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/compiletest/compiletest.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/test/compiletest/compiletest.rs b/src/test/compiletest/compiletest.rs index 2f3c6a6f953..2bca022eeb4 100644 --- a/src/test/compiletest/compiletest.rs +++ b/src/test/compiletest/compiletest.rs @@ -525,7 +525,8 @@ mod procsrv { export run; export close; - type handle = chan[request]; + type handle = rec(option::t[task] task, + chan[request] chan); tag request { exec(str, str, vec[str], chan[response]); @@ -535,22 +536,28 @@ mod procsrv { type response = rec(int pid, int outfd); fn mk() -> handle { - task::worker(worker).chan + auto res = task::worker(worker); + ret rec(task = option::some(res.task), + chan = res.chan); } fn clone(&handle handle) -> handle { - task::clone_chan(handle) + // Sharing tasks across tasks appears to be (yet another) recipe for + // disaster, so our handle clones will not get the task pointer. + rec(task = option::none, + chan = task::clone_chan(handle.chan)) } fn close(&handle handle) { - task::send(handle, stop); + task::send(handle.chan, stop); + task::join(option::get(handle.task)); } fn run(&handle handle, &str lib_path, &str prog, &vec[str] args) -> rec(int status, str out) { auto p = port[response](); auto ch = chan(p); - task::send(handle, + task::send(handle.chan, exec(lib_path, prog, args, ch)); auto resp = task::recv(p); |
