@@ -1,17 +1,17 @@
|
|
1 |
main:
|
2 |
shared a1_ready := semaphore(0)
|
3 |
shared b1_ready := semaphore(0)
|
4 |
create_thread(thread_a)
|
5 |
create_thread(thread_b)
|
6 |
|
7 |
thread_a:
|
8 |
statement a1
|
9 |
-
signal(a1_ready)
|
10 |
wait(b1_ready)
|
|
|
11 |
statement a2
|
12 |
|
13 |
thread_b:
|
14 |
statement b1
|
15 |
-
signal(b1_ready)
|
16 |
wait(a1_ready)
|
|
|
17 |
statement b2
|
1 |
main:
|
2 |
shared a1_ready := semaphore(0)
|
3 |
shared b1_ready := semaphore(0)
|
4 |
create_thread(thread_a)
|
5 |
create_thread(thread_b)
|
6 |
|
7 |
thread_a:
|
8 |
statement a1
|
|
|
9 |
wait(b1_ready)
|
10 |
+
signal(a1_ready)
|
11 |
statement a2
|
12 |
|
13 |
thread_b:
|
14 |
statement b1
|
|
|
15 |
wait(a1_ready)
|
16 |
+
signal(b1_ready)
|
17 |
statement b2
|