-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a990b5f
commit 27dd030
Showing
4 changed files
with
73 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// NOMAC PARAM: --set ana.activated[+] 'pthreadBarriers' | ||
#include<pthread.h> | ||
#include<stdio.h> | ||
#include<unistd.h> | ||
|
||
int g; | ||
|
||
pthread_barrier_t barrier; | ||
|
||
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
int top; | ||
int i = 0; | ||
|
||
pthread_barrierattr_t barattr; | ||
pthread_barrierattr_setpshared(&barattr, PTHREAD_PROCESS_SHARED); | ||
|
||
pthread_barrier_init(&barrier, &barattr, 2); | ||
|
||
fork(); | ||
pthread_t t1; | ||
|
||
if(top) { | ||
pthread_barrier_wait(&barrier); | ||
// Reachable if both processes go into this branch | ||
i = 1; | ||
} | ||
|
||
|
||
__goblint_check(i == 0); //UNKNOWN! | ||
|
||
|
||
return 0; | ||
} |