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
28e68298
Kaydet (Commit)
28e68298
authored
Mar 18, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use SolarMutexGuard directly
Change-Id: I1eeaebf1411b44c5881e2c08d95debb533e66b4e
üst
8a2e5420
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
38 deletions
+16
-38
desktop.hxx
framework/inc/services/desktop.hxx
+0
-2
desktop.cxx
framework/source/services/desktop.cxx
+16
-36
No files found.
framework/inc/services/desktop.hxx
Dosyayı görüntüle @
28e68298
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
#include <sal/config.h>
#include <sal/config.h>
#include <classes/framecontainer.hxx>
#include <classes/framecontainer.hxx>
#include <threadhelp/threadhelpbase.hxx>
#include <com/sun/star/frame/XUntitledNumbers.hpp>
#include <com/sun/star/frame/XUntitledNumbers.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XController.hpp>
...
@@ -98,7 +97,6 @@ typedef cppu::WeakComponentImplHelper6<
...
@@ -98,7 +97,6 @@ typedef cppu::WeakComponentImplHelper6<
css
::
frame
::
XUntitledNumbers
>
Desktop_BASE
;
css
::
frame
::
XUntitledNumbers
>
Desktop_BASE
;
class
Desktop
:
private
cppu
::
BaseMutex
,
class
Desktop
:
private
cppu
::
BaseMutex
,
private
ThreadHelpBase
,
private
TransactionBase
,
private
TransactionBase
,
public
Desktop_BASE
,
public
Desktop_BASE
,
public
cppu
::
OPropertySetHelper
public
cppu
::
OPropertySetHelper
...
...
framework/source/services/desktop.cxx
Dosyayı görüntüle @
28e68298
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
#include <dispatch/interceptionhelper.hxx>
#include <dispatch/interceptionhelper.hxx>
#include <classes/taskcreator.hxx>
#include <classes/taskcreator.hxx>
#include <threadhelp/transactionguard.hxx>
#include <threadhelp/transactionguard.hxx>
#include <threadhelp/guard.hxx>
#include <general.h>
#include <general.h>
#include <properties.h>
#include <properties.h>
...
@@ -154,15 +153,14 @@ void Desktop::constructorInit()
...
@@ -154,15 +153,14 @@ void Desktop::constructorInit()
@onerror We throw an ASSERT in debug version or do nothing in relaese version.
@onerror We throw an ASSERT in debug version or do nothing in relaese version.
*//*-*************************************************************************************************************/
*//*-*************************************************************************************************************/
Desktop
::
Desktop
(
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
xContext
)
Desktop
::
Desktop
(
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
xContext
)
:
ThreadHelpBase
(
&
Application
::
GetSolarMutex
()
)
:
TransactionBase
(
)
,
TransactionBase
(
)
,
Desktop_BASE
(
m_aMutex
)
,
Desktop_BASE
(
m_aMutex
)
,
cppu
::
OPropertySetHelper
(
cppu
::
WeakComponentImplHelperBase
::
rBHelper
)
,
cppu
::
OPropertySetHelper
(
cppu
::
WeakComponentImplHelperBase
::
rBHelper
)
// Init member
// Init member
,
m_bIsTerminated
(
sal_False
)
// see dispose() for further information!
,
m_bIsTerminated
(
sal_False
)
// see dispose() for further information!
,
m_xContext
(
xContext
)
,
m_xContext
(
xContext
)
,
m_aChildTaskContainer
(
)
,
m_aChildTaskContainer
(
)
,
m_aListenerContainer
(
m_a
Lock
.
getShareableOslMutex
()
)
,
m_aListenerContainer
(
m_a
Mutex
)
,
m_xFramesHelper
(
)
,
m_xFramesHelper
(
)
,
m_xDispatchHelper
(
)
,
m_xDispatchHelper
(
)
,
m_eLoadState
(
E_NOTSET
)
,
m_eLoadState
(
E_NOTSET
)
...
@@ -220,7 +218,7 @@ sal_Bool SAL_CALL Desktop::terminate()
...
@@ -220,7 +218,7 @@ sal_Bool SAL_CALL Desktop::terminate()
{
{
TransactionGuard
aTransaction
(
m_aTransactionManager
,
E_HARDEXCEPTIONS
);
TransactionGuard
aTransaction
(
m_aTransactionManager
,
E_HARDEXCEPTIONS
);
Guard
aReadLock
(
m_aLock
);
// start synchronize
SolarMutexClearableGuard
aReadLock
;
css
::
uno
::
Reference
<
css
::
frame
::
XTerminateListener
>
xPipeTerminator
=
m_xPipeTerminator
;
css
::
uno
::
Reference
<
css
::
frame
::
XTerminateListener
>
xPipeTerminator
=
m_xPipeTerminator
;
css
::
uno
::
Reference
<
css
::
frame
::
XTerminateListener
>
xQuickLauncher
=
m_xQuickLauncher
;
css
::
uno
::
Reference
<
css
::
frame
::
XTerminateListener
>
xQuickLauncher
=
m_xQuickLauncher
;
...
@@ -230,7 +228,7 @@ sal_Bool SAL_CALL Desktop::terminate()
...
@@ -230,7 +228,7 @@ sal_Bool SAL_CALL Desktop::terminate()
css
::
lang
::
EventObject
aEvent
(
static_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
);
css
::
lang
::
EventObject
aEvent
(
static_cast
<
::
cppu
::
OWeakObject
*
>
(
this
)
);
::
sal_Bool
bAskQuickStart
=
!
m_bSuspendQuickstartVeto
;
::
sal_Bool
bAskQuickStart
=
!
m_bSuspendQuickstartVeto
;
aReadLock
.
unlock
();
// end synchronize
aReadLock
.
clear
();
// Ask normal terminate listener. They could stop terminate without closing any open document.
// Ask normal terminate listener. They could stop terminate without closing any open document.
...
@@ -315,9 +313,9 @@ sal_Bool SAL_CALL Desktop::terminate()
...
@@ -315,9 +313,9 @@ sal_Bool SAL_CALL Desktop::terminate()
// "Protect" us against dispose before terminate calls!
// "Protect" us against dispose before terminate calls!
// see dispose() for further information.
// see dispose() for further information.
/* SAFE AREA --------------------------------------------------------------------------------------- */
/* SAFE AREA --------------------------------------------------------------------------------------- */
Guard
aWriteLock
(
m_aLock
)
;
SolarMutexClearableGuard
aWriteLock
;
m_bIsTerminated
=
sal_True
;
m_bIsTerminated
=
sal_True
;
aWriteLock
.
unlock
();
aWriteLock
.
clear
();
/* UNSAFE AREA ------------------------------------------------------------------------------------- */
/* UNSAFE AREA ------------------------------------------------------------------------------------- */
impl_sendNotifyTerminationEvent
();
impl_sendNotifyTerminationEvent
();
...
@@ -387,8 +385,7 @@ void SAL_CALL Desktop::addTerminateListener( const css::uno::Reference< css::fra
...
@@ -387,8 +385,7 @@ void SAL_CALL Desktop::addTerminateListener( const css::uno::Reference< css::fra
{
{
OUString
sImplementationName
=
xInfo
->
getImplementationName
();
OUString
sImplementationName
=
xInfo
->
getImplementationName
();
// SYCNHRONIZED ->
SolarMutexGuard
g
;
Guard
aWriteLock
(
m_aLock
);
if
(
sImplementationName
==
"com.sun.star.comp.sfx2.SfxTerminateListener"
)
if
(
sImplementationName
==
"com.sun.star.comp.sfx2.SfxTerminateListener"
)
{
{
...
@@ -410,9 +407,6 @@ void SAL_CALL Desktop::addTerminateListener( const css::uno::Reference< css::fra
...
@@ -410,9 +407,6 @@ void SAL_CALL Desktop::addTerminateListener( const css::uno::Reference< css::fra
m_xSWThreadManager
=
xListener
;
m_xSWThreadManager
=
xListener
;
return
;
return
;
}
}
aWriteLock
.
unlock
();
// <- SYCNHRONIZED
}
}
// No lock required ... container is threadsafe by itself.
// No lock required ... container is threadsafe by itself.
...
@@ -430,8 +424,7 @@ void SAL_CALL Desktop::removeTerminateListener( const css::uno::Reference< css::
...
@@ -430,8 +424,7 @@ void SAL_CALL Desktop::removeTerminateListener( const css::uno::Reference< css::
{
{
OUString
sImplementationName
=
xInfo
->
getImplementationName
();
OUString
sImplementationName
=
xInfo
->
getImplementationName
();
// SYCNHRONIZED ->
SolarMutexGuard
g
;
Guard
aWriteLock
(
m_aLock
);
if
(
sImplementationName
==
"com.sun.star.comp.sfx2.SfxTerminateListener"
)
if
(
sImplementationName
==
"com.sun.star.comp.sfx2.SfxTerminateListener"
)
{
{
...
@@ -456,9 +449,6 @@ void SAL_CALL Desktop::removeTerminateListener( const css::uno::Reference< css::
...
@@ -456,9 +449,6 @@ void SAL_CALL Desktop::removeTerminateListener( const css::uno::Reference< css::
m_xSWThreadManager
.
clear
();
m_xSWThreadManager
.
clear
();
return
;
return
;
}
}
aWriteLock
.
unlock
();
// <- SYCNHRONIZED
}
}
// No lock required ... container is threadsafe by itself.
// No lock required ... container is threadsafe by itself.
...
@@ -846,19 +836,14 @@ css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL Desktop::getCreator(
...
@@ -846,19 +836,14 @@ css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL Desktop::getCreator(
OUString
SAL_CALL
Desktop
::
getName
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
OUString
SAL_CALL
Desktop
::
getName
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
{
/* SAFE { */
SolarMutexGuard
g
;
Guard
aReadLock
(
m_aLock
);
return
m_sName
;
return
m_sName
;
/* } SAFE */
}
}
void
SAL_CALL
Desktop
::
setName
(
const
OUString
&
sName
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
void
SAL_CALL
Desktop
::
setName
(
const
OUString
&
sName
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
{
/* SAFE { */
SolarMutexGuard
g
;
Guard
aWriteLock
(
m_aLock
);
m_sName
=
sName
;
m_sName
=
sName
;
aWriteLock
.
unlock
();
/* } SAFE */
}
}
sal_Bool
SAL_CALL
Desktop
::
isTop
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
sal_Bool
SAL_CALL
Desktop
::
isTop
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
...
@@ -1087,7 +1072,7 @@ void SAL_CALL Desktop::disposing()
...
@@ -1087,7 +1072,7 @@ void SAL_CALL Desktop::disposing()
// tests for instance in sc/qa/unit) nothing bad happens.
// tests for instance in sc/qa/unit) nothing bad happens.
SAL_WARN_IF
(
!
m_bIsTerminated
,
"fwk"
,
"Desktop disposed before terminating it"
);
SAL_WARN_IF
(
!
m_bIsTerminated
,
"fwk"
,
"Desktop disposed before terminating it"
);
Guard
aWriteLock
(
m_aLock
);
// start synchronize
SolarMutexClearableGuard
aWriteLock
;
// Look for multiple calls of this method!
// Look for multiple calls of this method!
// If somewhere call dispose() twice - he will be stopped here really!!!
// If somewhere call dispose() twice - he will be stopped here really!!!
...
@@ -1108,7 +1093,7 @@ void SAL_CALL Desktop::disposing()
...
@@ -1108,7 +1093,7 @@ void SAL_CALL Desktop::disposing()
// and reject all new incoming requests!
// and reject all new incoming requests!
m_aTransactionManager
.
setWorkingMode
(
E_BEFORECLOSE
);
m_aTransactionManager
.
setWorkingMode
(
E_BEFORECLOSE
);
aWriteLock
.
unlock
();
// end synchronize
aWriteLock
.
clear
();
// Following lines of code can be called outside a synchronized block ...
// Following lines of code can be called outside a synchronized block ...
// Because our transaction manager will block all new requests to this object.
// Because our transaction manager will block all new requests to this object.
...
@@ -1210,8 +1195,7 @@ void SAL_CALL Desktop::dispatchFinished( const css::frame::DispatchResultEvent&
...
@@ -1210,8 +1195,7 @@ void SAL_CALL Desktop::dispatchFinished( const css::frame::DispatchResultEvent&
// Register transaction and reject wrong calls.
// Register transaction and reject wrong calls.
TransactionGuard
aTransaction
(
m_aTransactionManager
,
E_HARDEXCEPTIONS
);
TransactionGuard
aTransaction
(
m_aTransactionManager
,
E_HARDEXCEPTIONS
);
/* SAFE AREA ------------------------------------------------------------------------------------------- */
SolarMutexGuard
g
;
Guard
aWriteLock
(
m_aLock
);
if
(
m_eLoadState
!=
E_INTERACTION
)
if
(
m_eLoadState
!=
E_INTERACTION
)
{
{
m_xLastFrame
=
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
();
m_xLastFrame
=
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
();
...
@@ -1223,7 +1207,6 @@ void SAL_CALL Desktop::dispatchFinished( const css::frame::DispatchResultEvent&
...
@@ -1223,7 +1207,6 @@ void SAL_CALL Desktop::dispatchFinished( const css::frame::DispatchResultEvent&
m_eLoadState
=
E_SUCCESSFUL
;
m_eLoadState
=
E_SUCCESSFUL
;
}
}
}
}
/* UNSAFE AREA ----------------------------------------------------------------------------------------- */
}
}
/*-************************************************************************************************************
/*-************************************************************************************************************
...
@@ -1334,18 +1317,15 @@ void SAL_CALL Desktop::handle( const css::uno::Reference< css::task::XInteractio
...
@@ -1334,18 +1317,15 @@ void SAL_CALL Desktop::handle( const css::uno::Reference< css::task::XInteractio
bAbort
=
sal_True
;
bAbort
=
sal_True
;
}
}
/* SAFE AREA ------------------------------------------------------------------------------------------- */
// Ok now it's time to break yield loop of loadComponentFromURL().
// Ok now it's time to break yield loop of loadComponentFromURL().
// But only for really aborted requests!
// But only for really aborted requests!
// For example warnings will be approved and we wait for any success story ...
// For example warnings will be approved and we wait for any success story ...
if
(
bAbort
)
if
(
bAbort
)
{
{
Guard
aWriteLock
(
m_aLock
)
;
SolarMutexGuard
g
;
m_eLoadState
=
E_INTERACTION
;
m_eLoadState
=
E_INTERACTION
;
m_aInteractionRequest
=
aRequest
;
m_aInteractionRequest
=
aRequest
;
aWriteLock
.
unlock
();
}
}
/* UNSAFE AREA ----------------------------------------------------------------------------------------- */
}
}
...
@@ -1804,9 +1784,9 @@ void Desktop::impl_sendNotifyTerminationEvent()
...
@@ -1804,9 +1784,9 @@ void Desktop::impl_sendNotifyTerminationEvent()
::
sal_Bool
Desktop
::
impl_closeFrames
(
::
sal_Bool
bAllowUI
)
::
sal_Bool
Desktop
::
impl_closeFrames
(
::
sal_Bool
bAllowUI
)
{
{
Guard
aReadLock
(
m_aLock
);
// start synchronize
SolarMutexClearableGuard
aReadLock
;
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
>
lFrames
=
m_aChildTaskContainer
.
getAllElements
();
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
>
lFrames
=
m_aChildTaskContainer
.
getAllElements
();
aReadLock
.
unlock
();
// end synchronize
aReadLock
.
clear
();
::
sal_Int32
c
=
lFrames
.
getLength
();
::
sal_Int32
c
=
lFrames
.
getLength
();
::
sal_Int32
i
=
0
;
::
sal_Int32
i
=
0
;
...
...
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