I hope to get rid of SmartMutex et similia in the short to medium term, now that C++ has a decent infrastructure for locking.
Some comments (on the patch):
!) SmartMutex by default allows recursion but I'm not entirely sure we need that here? Anyway, to keep the semantic equivalent to the existing code I switched to std::recursive_mutex.
- I'm not entirely sure if we want to guard the mutex code with #if defined(LLVM_ENABLE_THREADS) to make it a no-op in the single threaded case. I wasn't able to measure a substantial impact when benchmarking, but, that goes without saying, your mileage may vary and, of course, feedback welcome.