aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-29 15:18:36 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-29 15:18:36 +0100
commit655931f0ea282f8dbaa769a213311a774e4f84c6 (patch)
tree4758fbc2fc736c3e51ecf9d02c01b110ceb1d97d /code
parentca36fabfc0496a3be2c20020b992c4ed38860aa9 (diff)
Minor Simplification of threading demo
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin11
1 files changed, 4 insertions, 7 deletions
diff --git a/code/demo.odin b/code/demo.odin
index 9f47eb1d9..26a91e452 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -17,14 +17,10 @@ prefix_table := [...]string{
};
worker_proc :: proc(t: ^thread.Thread) -> int {
- do_work :: proc(iteration: int, index: int) {
- fmt.printf("`%s`: iteration %d\n", prefix_table[index], iteration);
- win32.sleep(1);
- }
-
for iteration in 1...5 {
- fmt.printf("Thread %d is on iteration %d\n", t.user_index, iteration);
- do_work(iteration, t.user_index);
+ fmt.printf("Th/read %d is on iteration %d\n", t.user_index, iteration);
+ fmt.printf("`%s`: iteration %d\n", prefix_table[t.user_index], iteration);
+ win32.sleep(1);
}
return 0;
}
@@ -56,3 +52,4 @@ main :: proc() {
}
}
}
+