-
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 #1224 from goblint/issue-392
Add unknown thread ID
- Loading branch information
Showing
11 changed files
with
165 additions
and
39 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
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
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,34 @@ | ||
//PARAM: --set ana.activated[+] threadJoins | ||
#include <pthread.h> | ||
|
||
int g = 10; | ||
int h = 10; | ||
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; | ||
|
||
void *t_fun(void *arg) { | ||
g++; // RACE! | ||
return NULL; | ||
} | ||
|
||
void *t_benign(void *arg) { | ||
h++; // NORACE | ||
pthread_t id2; | ||
pthread_create(&id2, NULL, t_fun, NULL); | ||
foo(&id2); | ||
pthread_join(id2, NULL); | ||
return NULL; | ||
} | ||
|
||
int main(void) { | ||
int t; | ||
|
||
pthread_t id2; | ||
pthread_create(&id2, NULL, t_benign, NULL); | ||
pthread_join(id2, NULL); | ||
// t_benign and t_fun should be in here | ||
|
||
g++; // RACE! | ||
h++; // NORACE | ||
|
||
return 0; | ||
} |