update credits
[LibreOffice.git] / framework / inc / threadhelp / threadhelpbase.hxx
blobb13959880a91223ef9185f9acdc04caf1120ad3e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_
21 #define __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_
23 #include <threadhelp/lockhelper.hxx>
25 namespace framework{
27 /*-************************************************************************************************************//**
28 @short "baseclass" to make own classes threadsafe
29 @descr Sometimes you must share your lock- or mutex member with any other baseclasses.
30 And baseclasses are initialized erlier then members! That's why you should use
31 this struct as first of your baseclasses!!!
32 Then you will get a public member "m_aLock" which can be used by special guard implementations
33 to make your code threadsafe.
35 @seealso class LockHelper
37 @implements -
38 @base -
40 @devstatus ready to use
41 *//*-*************************************************************************************************************/
42 struct ThreadHelpBase
44 //-------------------------------------------------------------------------------------------------------------
45 // public methods
46 //-------------------------------------------------------------------------------------------------------------
47 public:
48 ThreadHelpBase( comphelper::SolarMutex* pSolarMutex = NULL )
49 : m_aLock( pSolarMutex )
53 //-------------------------------------------------------------------------------------------------------------
54 // public member
55 // Make it mutable for using in const functions!
56 //-------------------------------------------------------------------------------------------------------------
57 public:
59 mutable LockHelper m_aLock;
62 } // namespace framework
64 #endif // #ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */