[PATCH] D10480: Implement shared_mutex re: N4508
David Chisnall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 10 03:45:45 PDT 2018
theraven added a comment.
I missed this when it went in and coming across the code now I'm quite surprised that it did. Why is `shared_mutex` not implemented as a wrapper around rwlocks (pthreads and Windows both provide this abstraction)? The current implementation looks a lot less efficient than the system version on any operating system that I'm familiar with and has the added effect that native_handle isn't possible to implement, meaning that these can't easily interoperate with C APIs either.
I don't see a way of fixing this without an ABI break, unfortunately. Perhaps we can provide a better implementation in the __v2 namespace and let users (and platforms that don't care about binary compatibility with older libc++) opt in?
https://reviews.llvm.org/D10480
More information about the cfe-commits
mailing list