<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi, Daniel. I'm wondering why we need a Locked state at all. We still want to support an unbalanced unlock, and if we want to handle recursive locks (<a href="http://llvm.org/bugs/show_bug.cgi?id=10418">PR10418</a>) we'd have to do more work anyway than just "locked" or "unlocked". (The existence of recursive locks means that a double-unlock warning isn't always correct.)</div><div><br></div><div>I didn't look at the patch too closely, but it mostly looks sensible. What do you think about this, though?</div><div>Jordan</div><div><br></div><br><div><div>On Mar 13, 2014, at 16:32 , Daniel Fahlgren <<a href="mailto:daniel@fahlgren.se">daniel@fahlgren.se</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Jordan,<br><br>This patch makes the pthread checker detect double unlocks. I have<br>copied the idea with a map from the stream checker, not sure if that is<br>the best approach?<br><br>Tracking the state will later make it possible to warn if you lock a<br>destroyed mutex, calls pthread_init twice etc. But I haven't had time<br>for that yet.<br><br>Best regards,<br>Daniel Fahlgren<br><span><pthread.diff></span></blockquote></div><br></body></html>