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