<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 26 February 2014 17:30, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
It's not trivial, but I'm moderately familiar with how to implement a reasonable RW mutex on top of a mutex. Would you prefer that? I'm happy to contribute such an implementation.</blockquote><div><br></div>
<div>Thanks -- I'm familiar with how to do that too, and I might add a pthread_rwlock implementation to nacl-newlib's libpthread at some point. It seems like overkill to add a rwlock implementation to LLVM, though, because it would currently only get used under NaCl, and only for a very small number of uses in LLVM.</div>
<div><br></div><div>I just didn't want to leave lib/Support/Unix/RWMutex.cpp as a silently-unsafe fallback code path, because that could cause nasty surprises for other people in the future. Another option here would just be to have writer_acquire() call report_fatal_error(), but it seemed better to add a simple but non-optimal implementation that works. :-)</div>
<div><br></div><div>Cheers,</div><div>Mark</div><div><br></div></div></div></div>