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
cf575ec1
Kaydet (Commit)
cf575ec1
authored
Eki 24, 2010
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
give me a deterministic ctor/dtor ordering I can trust, and defer to first use
üst
31ff4439
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
EnvStack.cxx
cppu/source/uno/EnvStack.cxx
+16
-10
No files found.
cppu/source/uno/EnvStack.cxx
Dosyayı görüntüle @
cf575ec1
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
#include "cppu/EnvDcp.hxx"
#include "cppu/EnvDcp.hxx"
#include "cppu/Enterable.hxx"
#include "cppu/Enterable.hxx"
#include "rtl/instance.hxx"
#include "osl/thread.h"
#include "osl/thread.h"
#include "osl/mutex.hxx"
#include "osl/mutex.hxx"
...
@@ -68,9 +70,11 @@ typedef ::std::hash_map<oslThreadIdentifier,
...
@@ -68,9 +70,11 @@ typedef ::std::hash_map<oslThreadIdentifier,
oslThreadIdentifier_hash
,
oslThreadIdentifier_hash
,
oslThreadIdentifier_equal
>
ThreadMap
;
oslThreadIdentifier_equal
>
ThreadMap
;
static
osl
::
Mutex
s_threadMap_mutex
;
namespace
static
ThreadMap
s_threadMap
;
{
struct
s_threadMap_mutex
:
public
rtl
::
Static
<
osl
::
Mutex
,
s_threadMap_mutex
>
{};
struct
s_threadMap
:
public
rtl
::
Static
<
ThreadMap
,
s_threadMap
>
{};
}
static
rtl
::
OUString
s_uno_envDcp
(
RTL_CONSTASCII_USTRINGPARAM
(
UNO_LB_UNO
));
static
rtl
::
OUString
s_uno_envDcp
(
RTL_CONSTASCII_USTRINGPARAM
(
UNO_LB_UNO
));
...
@@ -78,14 +82,15 @@ static void s_setCurrent(uno_Environment * pEnv)
...
@@ -78,14 +82,15 @@ static void s_setCurrent(uno_Environment * pEnv)
{
{
oslThreadIdentifier
threadId
=
osl_getThreadIdentifier
(
NULL
);
oslThreadIdentifier
threadId
=
osl_getThreadIdentifier
(
NULL
);
osl
::
MutexGuard
guard
(
s_threadMap_mutex
);
osl
::
MutexGuard
guard
(
s_threadMap_mutex
::
get
());
ThreadMap
&
rThreadMap
=
s_threadMap
::
get
();
if
(
pEnv
)
if
(
pEnv
)
s_t
hreadMap
[
threadId
]
=
pEnv
;
rT
hreadMap
[
threadId
]
=
pEnv
;
else
else
{
{
ThreadMap
::
iterator
iEnv
=
s_t
hreadMap
.
find
(
threadId
);
ThreadMap
::
iterator
iEnv
=
rT
hreadMap
.
find
(
threadId
);
s_t
hreadMap
.
erase
(
iEnv
);
rT
hreadMap
.
erase
(
iEnv
);
}
}
}
}
...
@@ -95,9 +100,10 @@ static uno_Environment * s_getCurrent(void)
...
@@ -95,9 +100,10 @@ static uno_Environment * s_getCurrent(void)
oslThreadIdentifier
threadId
=
osl_getThreadIdentifier
(
NULL
);
oslThreadIdentifier
threadId
=
osl_getThreadIdentifier
(
NULL
);
osl
::
MutexGuard
guard
(
s_threadMap_mutex
);
osl
::
MutexGuard
guard
(
s_threadMap_mutex
::
get
());
ThreadMap
::
iterator
iEnv
=
s_threadMap
.
find
(
threadId
);
ThreadMap
&
rThreadMap
=
s_threadMap
::
get
();
if
(
iEnv
!=
s_threadMap
.
end
())
ThreadMap
::
iterator
iEnv
=
rThreadMap
.
find
(
threadId
);
if
(
iEnv
!=
rThreadMap
.
end
())
pEnv
=
iEnv
->
second
;
pEnv
=
iEnv
->
second
;
return
pEnv
;
return
pEnv
;
...
...
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