[Libreoffice-commits] core.git: drawinglayer/source svx/source
Thorsten Behrens
thb at documentfoundation.org
Tue Apr 30 03:17:57 PDT 2013
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 at iki.fi>
> Tested-by: Tor Lillqvist <tml at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130430/06491496/attachment.pgp>
More information about the LibreOffice
mailing list