source:
CIVL/examples/pthread/cprover/46_monabsex2_vs_true.c@
0fdf4bd
| Last change on this file since 0fdf4bd was e3151da, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 296 bytes | |
| Line | |
|---|---|
| 1 | #include <pthread.h> |
| 2 | |
| 3 | #define assert(e) { if(!(e)) { ERROR: goto ERROR; (void)0; } } |
| 4 | |
| 5 | _Bool s = 0; |
| 6 | __thread _Bool l = 0; |
| 7 | |
| 8 | void* thr1(void* arg) |
| 9 | { |
| 10 | assert(!l || s); |
| 11 | s = s || 1; |
| 12 | l = 1; //overapproximates |
| 13 | |
| 14 | return 0; |
| 15 | } |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | pthread_t t; |
| 20 | |
| 21 | while(1) pthread_create(&t, 0, thr1, 0); |
| 22 | } |
| 23 |
Note:
See TracBrowser
for help on using the repository browser.
