<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 30, 2009, at 11:55 PM, Nicolas Geoffray wrote:</div><blockquote type="cite"><div>So In my case (vmkit), I don't really care about /what/ is being locked <br>on. All I need is the information that the thread /is/ blocked. I <br>understand that for a debugging/monitoring/whatever system, it would be <br>nice to know /what/, but that demands a more high-level solution.<br></div></blockquote><div><br></div><div>OK, but you're likely to get a bunch of false positives for this.  Locks are (now) acquired in the process of type construction and constant creation, which happen all over the place, assuming you're running in multithreaded mode.</div><div><br></div><blockquote type="cite"><div>The only places where the VM-provided functions must be called is when <br>there are chances the thread will be blocked. I believe the only place <br>in llvm where a thread may be blocked is when it calls the <br>pthread_mutex_lock, and that is only in Mutex.cpp. I believe the <br>recursive and normal mutexes share the same function.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>Nope, see lib/System/RWMutex.cpp.  They don't share an implementation.</div><div><br></div><div>--Owen</div></body></html>