-
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.
Merge pull request #982 from goblint/issue-968
Improve `threadJoins` when it is used context-insensitively
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//PARAM: --set ana.activated[+] threadJoins --set ana.ctx_insens[+] threadJoins | ||
#include <pthread.h> | ||
|
||
int g = 10; | ||
|
||
void *t_fun(void *arg) { | ||
g++; //NORACE | ||
return NULL; | ||
} | ||
|
||
void benign() { | ||
// Causes must-joined set to be empty here! | ||
} | ||
|
||
int main(void) { | ||
int t; | ||
|
||
pthread_t id; | ||
pthread_create(&id, NULL, t_fun, NULL); | ||
|
||
benign(); | ||
pthread_join(id, NULL); | ||
benign(); | ||
g++; //NORACE | ||
|
||
|
||
return 0; | ||
} |