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