<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">- The `assert_capability` attribute is also a bit of a backdoor. Instead of statically propagating through the code that a mutex is held, we can just get that fact "out of thin air".<br></blockquote><div><br></div><div>Assert_capability is not a back door.  It is supposed to be used only on a function which does a run-time check:  if (!mu_.is_locked()) fail().  This sort of thing is very common in static analysis.  There are places in the code where you cannot statically prove that a property holds at compile-time, so you insert a run-time check into the code, and then propagate that property to the static analysis on the branch where the check succeeds.</div><div><br></div><div>Of course, you can use assert_capability to create a back door, by putting it on a function that doesn't actually check anything, just like you can declare random methods to be lock_functions, even if they don't lock anything.  :-)</div><div><br></div><div>  -DeLesley</div><div> </div></div>-- <br><div dir="ltr" class="gmail_signature">DeLesley Hutchins | Software Engineer | <a href="mailto:delesley@google.com" target="_blank">delesley@google.com</a> | 505-206-0315<br></div></div>