source: CIVL/examples/spawnassert.cvl@ db09fff

1.23 2.0 main test-branch
Last change on this file since db09fff was bf5d35f, checked in by Stephen Siegel <siegel@…>, 13 years ago

Adding new examples. Removed unused definition in build.xml.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@100 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 285 bytes
Line 
1#include <civlc.h>
2int N = 5; /* number of threads */
3$proc threads[N]; // the threads
4
5void run(int tid) {
6 $assert 0==1; // why isn't this run?
7 while (1==1) {
8 }
9}
10
11void main() {
12 for (int i=0; i<N; i++) threads[i] = $spawn run(i);
13 for (int i=0; i<N; i++) $wait threads[i];
14}
Note: See TracBrowser for help on using the repository browser.