std::mutex vs osl::Mutex

Stephan Bergmann sbergman at redhat.com
Fri Dec 9 08:00:16 UTC 2016


On 12/09/2016 04:04 AM, Kohei Yoshida wrote:
> Just a quick inquiry on whether we should continue to stick with
> osl::Mutex or, since now that we have C++11 as the baseline, we could
> perhaps switch to using std::mutex instead.

As always with new C++ features:

* Start a test balloon commit to see that the stuff indeed works with 
all our toolchains.  (I'd very much assume that's the case for 
std::mutex; e.g., Michael introduced a commit using std::mutex and 
std::condition_variable the other day.)

* Keep the URE interface at C++03.  (Which typically isn't much of a 
burden.  For one, backwards compatibility requirements preclude much 
change anyway.  And for another, compatible additions can be wrapped in 
LIBO_INTERNAL_ONLY---which has the added benefit of not needing to set 
things into stone prematurely.)

One big benefit of std::mutex over osl::Mutex is that it's non-recursive 
by default, which is generally the saner choice.


More information about the LibreOffice mailing list