[llvm-commits] [llvm] r73721 - /llvm/trunk/lib/VMCore/TypeSymbolTable.cpp

Duncan Sands baldrick at free.fr
Fri Jun 19 01:58:52 PDT 2009


Hi Owen,

> Simplify with SmartRWMutex.

when compiling without multithreading but with assertions enabled
you might want to have these smart mutexes still do same sanity
checking to try to catch cases when you would get a deadlock in the
multithreaded version.  For example, for a simple mutex you can have a
flag "acquired", set when acquiring and cleared when released, and
assert that the flag is not already set when acquiring, and assert that
the flag is set when releasing.  For other kinds of mutexes you can use
a counter etc.  Anyway, the point is that many many more people will
probably run the singlethreaded LLVM, so this kind of trick helps you
get limited multithreading testing from such people nonetheless.

Ciao,

Duncan.



More information about the llvm-commits mailing list