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
5d593158
Kaydet (Commit)
5d593158
authored
Mar 10, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
There's only a single DispatchWatcher, no need for a static mutex member
Change-Id: I410d07210bd80379fd2de1b8d76843794fa5f660
üst
32e70912
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
16 deletions
+5
-16
dispatchwatcher.cxx
desktop/source/app/dispatchwatcher.cxx
+4
-15
dispatchwatcher.hxx
desktop/source/app/dispatchwatcher.hxx
+1
-1
No files found.
desktop/source/app/dispatchwatcher.cxx
Dosyayı görüntüle @
5d593158
...
@@ -58,7 +58,6 @@
...
@@ -58,7 +58,6 @@
#include <osl/thread.hxx>
#include <osl/thread.hxx>
#include <osl/file.hxx>
#include <osl/file.hxx>
#include <osl/file.h>
#include <osl/file.h>
#include <rtl/instance.hxx>
#include <iostream>
#include <iostream>
using
namespace
::
osl
;
using
namespace
::
osl
;
...
@@ -170,16 +169,6 @@ OUString impl_GuessFilter( const OUString& rUrlOut, const OUString& rDocService
...
@@ -170,16 +169,6 @@ OUString impl_GuessFilter( const OUString& rUrlOut, const OUString& rDocService
}
}
namespace
{
class
theWatcherMutex
:
public
rtl
::
Static
<
Mutex
,
theWatcherMutex
>
{};
}
Mutex
&
DispatchWatcher
::
GetMutex
()
{
return
theWatcherMutex
::
get
();
}
DispatchWatcher
::
DispatchWatcher
()
DispatchWatcher
::
DispatchWatcher
()
:
m_nRequestCount
(
0
)
:
m_nRequestCount
(
0
)
{
{
...
@@ -317,7 +306,7 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatchRequ
...
@@ -317,7 +306,7 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatchRequ
if
(
xDispatcher
.
is
()
)
if
(
xDispatcher
.
is
()
)
{
{
{
{
::
osl
::
ClearableMutexGuard
aGuard
(
GetMutex
()
);
::
osl
::
ClearableMutexGuard
aGuard
(
m_mutex
);
// Remember request so we can find it in statusChanged!
// Remember request so we can find it in statusChanged!
m_aRequestContainer
.
emplace
(
aURL
.
Complete
,
1
);
m_aRequestContainer
.
emplace
(
aURL
.
Complete
,
1
);
m_nRequestCount
++
;
m_nRequestCount
++
;
...
@@ -698,7 +687,7 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatchRequ
...
@@ -698,7 +687,7 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatchRequ
xDisp
->
dispatchWithNotification
(
aDispatches
[
n
].
aURL
,
aArgs
,
this
);
xDisp
->
dispatchWithNotification
(
aDispatches
[
n
].
aURL
,
aArgs
,
this
);
else
else
{
{
::
osl
::
ClearableMutexGuard
aGuard
(
GetMutex
()
);
::
osl
::
ClearableMutexGuard
aGuard
(
m_mutex
);
m_nRequestCount
--
;
m_nRequestCount
--
;
aGuard
.
clear
();
aGuard
.
clear
();
xDispatch
->
dispatch
(
aDispatches
[
n
].
aURL
,
aArgs
);
xDispatch
->
dispatch
(
aDispatches
[
n
].
aURL
,
aArgs
);
...
@@ -706,7 +695,7 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatchRequ
...
@@ -706,7 +695,7 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatchRequ
}
}
}
}
::
osl
::
ClearableMutexGuard
aGuard
(
GetMutex
()
);
::
osl
::
ClearableMutexGuard
aGuard
(
m_mutex
);
bool
bEmpty
=
(
m_nRequestCount
==
0
);
bool
bEmpty
=
(
m_nRequestCount
==
0
);
aGuard
.
clear
();
aGuard
.
clear
();
...
@@ -738,7 +727,7 @@ void SAL_CALL DispatchWatcher::disposing( const css::lang::EventObject& )
...
@@ -738,7 +727,7 @@ void SAL_CALL DispatchWatcher::disposing( const css::lang::EventObject& )
void
SAL_CALL
DispatchWatcher
::
dispatchFinished
(
const
DispatchResultEvent
&
)
throw
(
RuntimeException
,
std
::
exception
)
void
SAL_CALL
DispatchWatcher
::
dispatchFinished
(
const
DispatchResultEvent
&
)
throw
(
RuntimeException
,
std
::
exception
)
{
{
osl
::
ClearableMutexGuard
aGuard
(
GetMutex
()
);
osl
::
ClearableMutexGuard
aGuard
(
m_mutex
);
sal_Int16
nCount
=
--
m_nRequestCount
;
sal_Int16
nCount
=
--
m_nRequestCount
;
aGuard
.
clear
();
aGuard
.
clear
();
OfficeIPCThread
::
RequestsCompleted
();
OfficeIPCThread
::
RequestsCompleted
();
...
...
desktop/source/app/dispatchwatcher.hxx
Dosyayı görüntüle @
5d593158
...
@@ -85,7 +85,7 @@ class DispatchWatcher : public ::cppu::WeakImplHelper< css::frame::XDispatchResu
...
@@ -85,7 +85,7 @@ class DispatchWatcher : public ::cppu::WeakImplHelper< css::frame::XDispatchResu
bool
executeDispatchRequests
(
const
DispatchList
&
aDispatches
,
bool
bNoTerminate
=
false
);
bool
executeDispatchRequests
(
const
DispatchList
&
aDispatches
,
bool
bNoTerminate
=
false
);
private
:
private
:
static
::
osl
::
Mutex
&
GetMutex
()
;
osl
::
Mutex
m_mutex
;
std
::
unordered_map
<
OUString
,
sal_Int32
,
OUStringHash
>
std
::
unordered_map
<
OUString
,
sal_Int32
,
OUStringHash
>
m_aRequestContainer
;
m_aRequestContainer
;
...
...
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