Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
71b6f3d9
Kaydet (Commit)
71b6f3d9
authored
Nis 04, 2011
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use rtl::Static where double-locked pattern used
üst
44d24455
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
64 deletions
+45
-64
exc_thrower.cxx
cppuhelper/source/exc_thrower.cxx
+4
-21
factory.cxx
cppuhelper/source/factory.cxx
+8
-11
implbase.cxx
cppuhelper/source/implbase.cxx
+7
-11
shlib.cxx
cppuhelper/source/shlib.cxx
+26
-21
No files found.
cppuhelper/source/exc_thrower.cxx
Dosyayı görüntüle @
71b6f3d9
...
...
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_cppuhelper.hxx"
#include "rtl/instance.hxx"
#include "osl/diagnose.h"
#include "osl/doublecheckedlocking.h"
#include "osl/mutex.hxx"
...
...
@@ -58,8 +59,6 @@ struct ExceptionThrower : public uno_Interface, XExceptionThrower
{
inline
ExceptionThrower
();
public
:
static
ExceptionThrower
*
get
();
static
inline
Type
const
&
getCppuType
()
{
return
::
getCppuType
(
...
...
@@ -188,23 +187,7 @@ inline ExceptionThrower::ExceptionThrower()
uno_Interface
::
pDispatcher
=
ExceptionThrower_dispatch
;
}
//______________________________________________________________________________
ExceptionThrower
*
ExceptionThrower
::
get
()
{
ExceptionThrower
*
s_pThrower
=
0
;
if
(
s_pThrower
==
0
)
{
MutexGuard
guard
(
Mutex
::
getGlobalMutex
()
);
static
ExceptionThrower
s_thrower
;
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER
();
s_pThrower
=
&
s_thrower
;
}
else
{
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER
();
}
return
s_pThrower
;
}
class
theExceptionThrower
:
public
rtl
::
Static
<
ExceptionThrower
,
theExceptionThrower
>
{};
}
// anonymous namespace
...
...
@@ -234,7 +217,7 @@ void SAL_CALL throwException( Any const & exc ) SAL_THROW( (Exception) )
Reference
<
XExceptionThrower
>
xThrower
;
uno2cpp
.
mapInterface
(
reinterpret_cast
<
void
**
>
(
&
xThrower
),
static_cast
<
uno_Interface
*
>
(
ExceptionThrower
::
get
()
),
static_cast
<
uno_Interface
*
>
(
&
the
ExceptionThrower
::
get
()
),
ExceptionThrower
::
getCppuType
()
);
OSL_ASSERT
(
xThrower
.
is
()
);
xThrower
->
throwException
(
exc
);
...
...
@@ -265,7 +248,7 @@ Any SAL_CALL getCaughtException()
UnoInterfaceReference
unoI
;
cpp2uno
.
mapInterface
(
reinterpret_cast
<
void
**
>
(
&
unoI
.
m_pUnoI
),
static_cast
<
XExceptionThrower
*
>
(
ExceptionThrower
::
get
()
),
pTD
);
static_cast
<
XExceptionThrower
*
>
(
&
the
ExceptionThrower
::
get
()
),
pTD
);
OSL_ASSERT
(
unoI
.
is
()
);
typelib_TypeDescription
*
pMemberTD
=
0
;
...
...
cppuhelper/source/factory.cxx
Dosyayı görüntüle @
71b6f3d9
...
...
@@ -35,6 +35,7 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <rtl/instance.hxx>
#include <rtl/unload.h>
#include "cppuhelper/propshlp.hxx"
...
...
@@ -421,20 +422,16 @@ Sequence< Type > OFactoryComponentHelper::getTypes()
return
Sequence
<
Type
>
(
ar
,
m_fptr
?
4
:
3
);
}
namespace
{
class
theOFactoryComponentHelperImplementationId
:
public
rtl
::
Static
<
OImplementationId
,
theOFactoryComponentHelperImplementationId
>
{};
}
Sequence
<
sal_Int8
>
OFactoryComponentHelper
::
getImplementationId
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
static
OImplementationId
*
pId
=
0
;
if
(
!
pId
)
{
MutexGuard
aGuard
(
Mutex
::
getGlobalMutex
()
);
if
(
!
pId
)
{
static
OImplementationId
aId
;
pId
=
&
aId
;
}
}
return
pId
->
getImplementationId
();
return
theOFactoryComponentHelperImplementationId
::
get
().
getImplementationId
();
}
// XSingleServiceFactory
...
...
cppuhelper/source/implbase.cxx
Dosyayı görüntüle @
71b6f3d9
...
...
@@ -31,6 +31,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/compbase.hxx>
#include <osl/diagnose.h>
#include <rtl/instance.hxx>
#include <rtl/uuid.h>
#include <com/sun/star/lang/XComponent.hpp>
...
...
@@ -41,22 +42,17 @@ using namespace ::rtl;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
namespace
{
class
theImplHelperInitMutex
:
public
rtl
::
Static
<
Mutex
,
theImplHelperInitMutex
>
{};
}
namespace
cppu
{
//==================================================================================================
Mutex
&
SAL_CALL
getImplHelperInitMutex
(
void
)
SAL_THROW
(
()
)
{
static
Mutex
*
s_pMutex
=
0
;
if
(
!
s_pMutex
)
{
MutexGuard
aGuard
(
Mutex
::
getGlobalMutex
()
);
if
(
!
s_pMutex
)
{
static
Mutex
s_aMutex
;
s_pMutex
=
&
s_aMutex
;
}
}
return
*
s_pMutex
;
return
theImplHelperInitMutex
::
get
();
}
// ClassDataBase
...
...
cppuhelper/source/shlib.cxx
Dosyayı görüntüle @
71b6f3d9
...
...
@@ -35,6 +35,7 @@
#include "osl/module.hxx"
#include "rtl/unload.h"
#include "rtl/ustrbuf.hxx"
#include "rtl/instance.hxx"
#include "uno/environment.h"
#include "uno/mapping.hxx"
#include "cppuhelper/factory.hxx"
...
...
@@ -71,21 +72,20 @@ static inline void out( const OUString & r ) throw ()
}
#endif
//------------------------------------------------------------------------------
static
const
::
std
::
vector
<
OUString
>
*
getAccessDPath
()
SAL_THROW
(
()
)
namespace
{
static
::
std
::
vector
<
OUString
>
*
s_p
=
0
;
static
bool
s_bInit
=
false
;
if
(
!
s_bInit
)
class
buildAccessDPath
{
::
osl
::
MutexGuard
aGuard
(
::
osl
::
Mutex
::
getGlobalMutex
()
);
if
(
!
s_bInit
)
private
:
::
std
::
vector
<
OUString
>
m_aAccessDPath
;
bool
m_bCPLD_ACCESSPATHSet
;
public
:
buildAccessDPath
()
:
m_bCPLD_ACCESSPATHSet
(
false
)
{
const
char
*
pEnv
=
::
getenv
(
"CPLD_ACCESSPATH"
);
if
(
pEnv
)
{
static
::
std
::
vector
<
OUString
>
s_v
;
m_bCPLD_ACCESSPATHSet
=
true
;
OString
aEnv
(
pEnv
);
sal_Int32
nIndex
=
0
;
...
...
@@ -100,34 +100,39 @@ static const ::std::vector< OUString > * getAccessDPath() SAL_THROW( () )
{
OSL_ASSERT
(
false
);
}
s_v
.
push_back
(
aFileUrl
);
m_aAccessDPath
.
push_back
(
aFileUrl
);
}
while
(
nIndex
!=
-
1
);
#if OSL_DEBU
G_LEVEL > 1
#if OSL_
G_LEVEL > 1
out
(
"> cpld: acknowledged following access path(s):
\"
"
);
::
std
::
vector
<
OUString
>::
const_iterator
iPos
(
s_v
.
begin
()
);
while
(
iPos
!=
s_v
.
end
())
::
std
::
vector
<
OUString
>::
const_iterator
iPos
(
m_aAccessDPath
.
begin
()
);
while
(
iPos
!=
m_aAccessDPath
.
end
())
{
out
(
*
iPos
);
++
iPos
;
if
(
iPos
!=
s_v
.
end
())
if
(
iPos
!=
m_aAccessDPath
.
end
())
out
(
";"
);
}
out
(
"
\"\n
"
);
#endif
s_p
=
&
s_v
;
#endif
}
else
{
// no access path env set
#if OSL_DEBU
G_LEVEL > 1
#if OSL_
G_LEVEL > 1
out
(
"=> no CPLD_ACCESSPATH set.
\n
"
);
#endif
#endif
}
s_bInit
=
true
;
}
}
::
std
::
vector
<
OUString
>*
getAccessDPath
()
{
return
m_bCPLD_ACCESSPATHSet
?
&
m_aAccessDPath
:
NULL
;
}
};
class
theAccessDPath
:
public
rtl
::
Static
<
buildAccessDPath
,
theAccessDPath
>
{};
}
return
s_p
;
//------------------------------------------------------------------------------
static
const
::
std
::
vector
<
OUString
>
*
getAccessDPath
()
SAL_THROW
(
()
)
{
return
theAccessDPath
::
get
().
getAccessDPath
();
}
//------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment