source:
CIVL/examples/languageFeatures/commBad.cvl@
32410ee
| Last change on this file since 32410ee was 0ddb25b, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 377 bytes | |
| Line | |
|---|---|
| 1 | /* Deadlocking use of communicator. Commandline execution: |
| 2 | * civl verify commBad.cvl |
| 3 | * */ |
| 4 | #include <civlc.h> |
| 5 | #define TAG 0 |
| 6 | |
| 7 | $comm comm; |
| 8 | _Bool start = $false; |
| 9 | |
| 10 | void worker(int me) { |
| 11 | $when (start); |
| 12 | $comm_dequeue(&comm, me, TAG); |
| 13 | } |
| 14 | |
| 15 | void main() { |
| 16 | $proc worker_proc = $spawn worker(0); |
| 17 | |
| 18 | comm = $comm_create(1, &worker_proc); |
| 19 | start = $true; |
| 20 | $wait(worker_proc); |
| 21 | } |
Note:
See TracBrowser
for help on using the repository browser.
