main
test-branch
|
Last change
on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago |
|
Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
559 bytes
|
| Line | |
|---|
| 1 | extern void __VERIFIER_error();
|
|---|
| 2 |
|
|---|
| 3 | #include <pthread.h>
|
|---|
| 4 |
|
|---|
| 5 | int i=1, j=1;
|
|---|
| 6 |
|
|---|
| 7 | #define NUM 6
|
|---|
| 8 |
|
|---|
| 9 | void *
|
|---|
| 10 | t1(void* arg)
|
|---|
| 11 | {
|
|---|
| 12 | int k = 0;
|
|---|
| 13 |
|
|---|
| 14 | for (k = 0; k < NUM; k++)
|
|---|
| 15 | i+=j;
|
|---|
| 16 |
|
|---|
| 17 | pthread_exit(NULL);
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | void *
|
|---|
| 21 | t2(void* arg)
|
|---|
| 22 | {
|
|---|
| 23 | int k = 0;
|
|---|
| 24 |
|
|---|
| 25 | for (k = 0; k < NUM; k++)
|
|---|
| 26 | j+=i;
|
|---|
| 27 |
|
|---|
| 28 | pthread_exit(NULL);
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | int
|
|---|
| 32 | main(int argc, char **argv)
|
|---|
| 33 | {
|
|---|
| 34 | pthread_t id1, id2;
|
|---|
| 35 |
|
|---|
| 36 | pthread_create(&id1, NULL, t1, NULL);
|
|---|
| 37 | pthread_create(&id2, NULL, t2, NULL);
|
|---|
| 38 | pthread_join(id1, NULL);
|
|---|
| 39 | pthread_join(id2, NULL);
|
|---|
| 40 |
|
|---|
| 41 | if (i >= 377 || j >= 377) {
|
|---|
| 42 | ERROR: __VERIFIER_error();
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | return 0;
|
|---|
| 46 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.