On Thu, Mar 20, 2014 at 11:28 AM, Daniel Fahlgren <[email protected]> wrote:
> void foo() {
> pthread_mutex_init(&mtx, NULL);
> pthread_mutex_lock(&mtx);
> pthread_mutex_unlock(&mtx);
> pthread_mutex_unlock(&mtx);
> }
>
> should still yield a warning. However, if the call to pthread_mutex_init
> isn't present the checker shouldn't warn about the double unlock. I'll
> need to think more about this.
Note that due to the nature of the multithreaded code the call to
pthread_mutex_init() will be rarely visible to the analyzer through
inlining, I think.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits