Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Noel Grandin wrote:
    Clang cleanup, unused mutex variables
    
    Some of these were doing nothing useful at all. I removed those.
    A couple were protecting static data, and I fixed those to use Mutex
    and MutexGuard properly.
    
    Change-Id: I444d13f8b6c50e526cce8d69d09aeaf240e5c6ca
    Reviewed-on: https://gerrit.libreoffice.org/3678
    Reviewed-by: Tor Lillqvist <tml@iki.fi>
    Tested-by: Tor Lillqvist <tml@iki.fi>

[snip]

diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx 
b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index 77487db..495c06f 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -42,9 +42,10 @@ namespace drawinglayer
                 static Primitive3DSequence aLineTubeList;
                 static sal_uInt32 nLineTubeSegments(0L);
                 static attribute::MaterialAttribute3D aLineMaterial;
+                static ::osl::Mutex aMutex;
 
                 // may exclusively change static data, use mutex
-                ::osl::Mutex m_mutex;
+                ::osl::MutexGuard aGuard(aMutex);
 
Thanks a lot for that cleanup!

There are two more instances of that kind in this file though, and
beyond that - anyone eager to replace this with proper rtl::Static
(with the benefit of much faster subsequent access to the statics)?

Usage is rather nicely documented in include/rtl/instance.hxx - for
this case, StaticWithInit seems ideal.

Cheers,

-- Thorsten

Attachment: signature.asc
Description: Digital signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.