[Libreoffice] [Review Request] remove a confusing use of GetMutex() when a SolarMutexGuard is really meant

Norbert Thiebaud nthiebaud at gmail.com
Sun Oct 31 21:07:04 PDT 2010

The attached patches are pending... I am submitting them to the list
for comments or objections before pushing them.

The patches address the following:

VCLXDevice, VCLXGraphics and derived class use a mutex that is really
a reference to the SolarMutex. They declare a function GetMutex() to
access tis reference to the SolarMutex, and the implementation
osl::SolarGuard aGuard(GetMutex())
to take a guard on the solar mutex.

This is confusing because some other class in that framework also implement
a GetMutex() function, but which this time return a regular Mutex.

Since this particular use of GetMutex() is to get the SolarMutex, and
invariably this is then used to take a Guard on the SolarMutex,
all these uses are replaced by a SolarMutexGuard object, which encapsulate
that behavior.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-remove-a-confusing-use-of-GetMutex-when-a-S-libs-gui.patch
Type: text/x-patch
Size: 232283 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101031/fb4ce8b0/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-use-SolarMutexGuard-to-take-a-guard-on-th-components.patch
Type: text/x-patch
Size: 911 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101031/fb4ce8b0/attachment-0003.bin>

More information about the LibreOffice mailing list