source:
CIVL/examples/library/civlc/commBad.cvl
| Last change on this file was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 452 bytes | |
| Rev | Line | |
|---|---|---|
| [28717d7] | 1 | /* Deadlocking use of communicator. Commandline execution: |
| 2 | * civl verify commBad.cvl | |
| 3 | * */ | |
| [4208097] | 4 | #include <civlc.cvh> |
| 5 | #include <comm.cvh> | |
| [28717d7] | 6 | #define TAG 0 |
| [d66b03b] | 7 | $scope root = $here; |
| 8 | $gcomm gcomm = $gcomm_create(root, 2); | |
| [28717d7] | 9 | _Bool start = $false; |
| 10 | ||
| 11 | void worker(int me) { | |
| [0b9a80a] | 12 | $comm comm = $comm_create($here, gcomm, me); |
| [28717d7] | 13 | $when (start); |
| [0b9a80a] | 14 | $comm_dequeue(comm, me, TAG); |
| [28717d7] | 15 | } |
| 16 | ||
| 17 | void main() { | |
| 18 | $proc worker_proc = $spawn worker(0); | |
| 19 | ||
| 20 | start = $true; | |
| [a82987f] | 21 | $wait(worker_proc); |
| [28717d7] | 22 | } |
Note:
See TracBrowser
for help on using the repository browser.
