diff options
| author | Michael Bebenita <[email protected]> | 2010-08-24 21:06:56 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-08-24 21:07:14 -0700 |
| commit | 64ff82ecf98ceb4725f0f51c73e23d1efc2160bc (patch) | |
| tree | 6a6ae7452066716947c4d262eb72041a6a11cb95 /src/test/run-pass/task-comm-12.rs | |
| parent | Comment on env var required for std.dbg to do any logging. (diff) | |
| download | rust-64ff82ecf98ceb4725f0f51c73e23d1efc2160bc.tar.xz rust-64ff82ecf98ceb4725f0f51c73e23d1efc2160bc.zip | |
Implemented an lock free queue based on this paper http://www.cs.rochester.edu/~scott/papers/1996_PODC_queues.pdf, the "lock free queue" we had before wasn't lock free at all.
Diffstat (limited to 'src/test/run-pass/task-comm-12.rs')
| -rw-r--r-- | src/test/run-pass/task-comm-12.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs new file mode 100644 index 00000000..ab7c25e8 --- /dev/null +++ b/src/test/run-pass/task-comm-12.rs @@ -0,0 +1,23 @@ +use std; +import std._task; + +fn main() -> () { + test00(); +} + +fn start(int task_number) { + log "Started / Finished Task."; +} + +fn test00() { + let int i = 0; + let task t = spawn thread start(i); + + // Sleep long enough for the task to finish. + _task.sleep(10000u); + + // Try joining tasks that have already finished. + join t; + + log "Joined Task."; +}
\ No newline at end of file |