-
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.
Refine Points-To set on locking a mutex
- Loading branch information
1 parent
6392583
commit 880d59f
Showing
4 changed files
with
31 additions
and
3 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,20 @@ | ||
#include<pthread.h> | ||
|
||
pthread_mutex_t m1; | ||
pthread_mutex_t m2; | ||
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
int top; | ||
pthread_mutex_t* ptr; | ||
ptr = &m1; | ||
|
||
if(top) { | ||
ptr = &m2; | ||
} | ||
|
||
pthread_mutex_lock(ptr); | ||
pthread_mutex_unlock(ptr); //NOWARN | ||
|
||
return 0; | ||
} |