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
5652f529
Kaydet (Commit)
5652f529
authored
Eki 24, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1237350 use our double-locking templates for this
Change-Id: I589468e9663ffd01a237a1684345985396bc4eac
üst
03c870df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
23 deletions
+25
-23
ActiveMSPList.cxx
scripting/source/provider/ActiveMSPList.cxx
+21
-22
ActiveMSPList.hxx
scripting/source/provider/ActiveMSPList.hxx
+4
-1
No files found.
scripting/source/provider/ActiveMSPList.cxx
Dosyayı görüntüle @
5652f529
...
...
@@ -66,6 +66,26 @@ ActiveMSPList::createNewMSP( const uno::Any& context )
return
msp
;
}
class
NonDocMSPCreator
{
public
:
NonDocMSPCreator
(
ActiveMSPList
*
pList
)
{
pList
->
createNonDocMSPs
();
}
};
namespace
{
//thread-safe double-locked class to ensure createNonDocMSPs is called once
class
theNonDocMSPCreator
:
public
rtl
::
StaticWithArg
<
NonDocMSPCreator
,
ActiveMSPList
*
,
theNonDocMSPCreator
>
{};
void
ensureNonDocMSPs
(
ActiveMSPList
*
pList
)
{
theNonDocMSPCreator
::
get
(
pList
);
}
}
Reference
<
provider
::
XScriptProvider
>
ActiveMSPList
::
getMSPFromAnyContext
(
const
Any
&
aContext
)
{
...
...
@@ -105,7 +125,7 @@ ActiveMSPList::getMSPFromAnyContext( const Any& aContext )
return
msp
;
}
ensureNonDocMSPs
();
ensureNonDocMSPs
(
this
);
return
m_hMsps
[
shareDirString
];
}
...
...
@@ -287,27 +307,6 @@ ActiveMSPList::createNonDocMSPs()
m_hMsps
[
bundledDirString
]
=
bundledMsp
;
}
void
ActiveMSPList
::
ensureNonDocMSPs
()
{
static
bool
created
=
false
;
if
(
created
)
{
return
;
}
else
{
::
osl
::
MutexGuard
guard
(
m_mutex
);
if
(
created
)
{
return
;
}
createNonDocMSPs
();
created
=
true
;
}
}
}
// namespace func_provider
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
scripting/source/provider/ActiveMSPList.hxx
Dosyayı görüntüle @
5652f529
...
...
@@ -53,6 +53,8 @@ typedef ::boost::unordered_map< OUString,
OUStringHash
,
::
std
::
equal_to
<
OUString
>
>
Msp_hash
;
class
NonDocMSPCreator
;
class
ActiveMSPList
:
public
::
cppu
::
WeakImplHelper1
<
css
::
lang
::
XEventListener
>
{
...
...
@@ -88,8 +90,9 @@ private:
return
createNewMSP
(
css
::
uno
::
makeAny
(
context
)
);
}
void
ensureNonDocMSPs
()
;
friend
class
NonDocMSPCreator
;
void
createNonDocMSPs
();
Msp_hash
m_hMsps
;
ScriptComponent_map
m_mScriptComponents
;
osl
::
Mutex
m_mutex
;
...
...
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