@@ -1,12 +1,12 @@
|
|
1 |
procedure main(argc, argv[])
|
2 |
// create thread_count as result of converting argv[1] to integer
|
3 |
declare thread_count := integer(argv[1])
|
4 |
for thread_number := 0 to thread_count do
|
5 |
-
create_thread(greet, thread_number)
|
6 |
end for
|
7 |
print "Hello from main thread"
|
8 |
end procedure
|
9 |
|
10 |
-
procedure greet(thread_number)
|
11 |
-
print "Hello from secondary thread", thread_number
|
12 |
end procedure
|
1 |
procedure main(argc, argv[])
|
2 |
// create thread_count as result of converting argv[1] to integer
|
3 |
declare thread_count := integer(argv[1])
|
4 |
for thread_number := 0 to thread_count do
|
5 |
+
create_thread(greet, thread_number, thread_count) // thread team
|
6 |
end for
|
7 |
print "Hello from main thread"
|
8 |
end procedure
|
9 |
|
10 |
+
procedure greet(thread_number, thread_count)
|
11 |
+
print "Hello from secondary thread", thread_number, " of ", thread_count
|
12 |
end procedure
|