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
73fc75bf
Kaydet (Commit)
73fc75bf
authored
Eki 25, 2012
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ditch SYNCHRONIZED_START/END
Change-Id: I1c0c015f371346efc5712ead7abe9e7f2ec0f9d0
üst
9e44e1a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
58 deletions
+33
-58
general.h
framework/inc/general.h
+0
-19
dispatchprovider.cxx
framework/source/dispatch/dispatchprovider.cxx
+1
-2
desktop.cxx
framework/source/services/desktop.cxx
+32
-37
No files found.
framework/inc/general.h
Dosyayı görüntüle @
73fc75bf
...
@@ -48,25 +48,6 @@
...
@@ -48,25 +48,6 @@
*/
*/
namespace
css
=
::
com
::
sun
::
star
;
namespace
css
=
::
com
::
sun
::
star
;
namespace
framework
{
//-----------------------------------------------------------------------------
/** Those macro is used to make it more clear where a synchronized block will start.
Because normal documentation code wont be recognized by some developers to be real
I need something where they are thinking about.
At least this macro will do nothing ... it's empty.
But it should make the code more clear .-))
*/
#define SYNCHRONIZED_START
//-----------------------------------------------------------------------------
/** Same then SYNCHRONIZED_START ... but instead it mark the end of such code block.
*/
#define SYNCHRONIZED_END
}
// namespace framework
#endif // #ifndef __FRAMEWORK_GENERAL_H_
#endif // #ifndef __FRAMEWORK_GENERAL_H_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
framework/source/dispatch/dispatchprovider.cxx
Dosyayı görüntüle @
73fc75bf
...
@@ -230,8 +230,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryDeskt
...
@@ -230,8 +230,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryDeskt
// I.II) "_default"
// I.II) "_default"
// This is a combination of search an empty task for recycling - or create a new one.
// This is a combination of search an empty task for recycling - or create a new one.
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
else
else
if
(
sTargetFrameName
==
SPECIALTARGET_DEFAULT
)
if
(
sTargetFrameName
==
SPECIALTARGET_DEFAULT
)
{
{
if
(
implts_isLoadableContent
(
aURL
))
if
(
implts_isLoadableContent
(
aURL
))
xDispatcher
=
implts_getOrCreateDispatchHelper
(
E_DEFAULTDISPATCHER
,
xDesktop
);
xDispatcher
=
implts_getOrCreateDispatchHelper
(
E_DEFAULTDISPATCHER
,
xDesktop
);
...
...
framework/source/services/desktop.cxx
Dosyayı görüntüle @
73fc75bf
...
@@ -271,19 +271,17 @@ sal_Bool SAL_CALL Desktop::terminate()
...
@@ -271,19 +271,17 @@ sal_Bool SAL_CALL Desktop::terminate()
{
{
TransactionGuard
aTransaction
(
m_aTransactionManager
,
E_HARDEXCEPTIONS
);
TransactionGuard
aTransaction
(
m_aTransactionManager
,
E_HARDEXCEPTIONS
);
SYNCHRONIZED_START
ReadGuard
aReadLock
(
m_aLock
);
// start synchronize
ReadGuard
aReadLock
(
m_aLock
);
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
;
css
::
uno
::
Reference
<
css
::
frame
::
XTerminateListener
>
xSWThreadManager
=
m_xSWThreadManager
;
css
::
uno
::
Reference
<
css
::
frame
::
XTerminateListener
>
xSWThreadManager
=
m_xSWThreadManager
;
css
::
uno
::
Reference
<
css
::
frame
::
XTerminateListener
>
xSfxTerminator
=
m_xSfxTerminator
;
css
::
uno
::
Reference
<
css
::
frame
::
XTerminateListener
>
xSfxTerminator
=
m_xSfxTerminator
;
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
();
aReadLock
.
unlock
();
// end synchronize
SYNCHRONIZED_END
//-------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------
// 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.
...
@@ -1179,30 +1177,29 @@ void SAL_CALL Desktop::dispose()
...
@@ -1179,30 +1177,29 @@ void SAL_CALL Desktop::dispose()
fprintf
(
stderr
,
"This used to be an assertion failure: Desktop disposed before terminating it,
\n
"
fprintf
(
stderr
,
"This used to be an assertion failure: Desktop disposed before terminating it,
\n
"
"but nothing bad seems to happen anyway?
\n
"
);
"but nothing bad seems to happen anyway?
\n
"
);
#endif
#endif
SYNCHRONIZED_START
WriteGuard
aWriteLock
(
m_aLock
);
// Look for multiple calls of this method!
WriteGuard
aWriteLock
(
m_aLock
);
// start synchronize
// If somewhere call dispose() twice - he will be stopped here realy!!!
TransactionGuard
aTransaction
(
m_aTransactionManager
,
E_HARDEXCEPTIONS
);
// Now - we are alone and its the first call of this method ...
// otherwise call before had thrown a DisposedException / hopefully .-)
// But we dont use the transaction object created before ... we reset it immediatly ...
// two lines of code ... for what ?
// The answer: We wished to synchronize concurrent dispose() calls -> OK
// But next line will wait for all currently running transaction (even if they
// are running within the same thread!) So we would block ourself there if aTransaction
// will stay registered .-)
aTransaction
.
stop
();
// Disable this instance for further work.
// This will wait for all current running transactions ...
// and reject all new incoming requests!
m_aTransactionManager
.
setWorkingMode
(
E_BEFORECLOSE
);
aWriteLock
.
unlock
();
// Look for multiple calls of this method!
SYNCHRONIZED_END
// If somewhere call dispose() twice - he will be stopped here realy!!!
TransactionGuard
aTransaction
(
m_aTransactionManager
,
E_HARDEXCEPTIONS
);
// Now - we are alone and its the first call of this method ...
// otherwise call before had thrown a DisposedException / hopefully .-)
// But we dont use the transaction object created before ... we reset it immediatly ...
// two lines of code ... for what ?
// The answer: We wished to synchronize concurrent dispose() calls -> OK
// But next line will wait for all currently running transaction (even if they
// are running within the same thread!) So we would block ourself there if aTransaction
// will stay registered .-)
aTransaction
.
stop
();
// Disable this instance for further work.
// This will wait for all current running transactions ...
// and reject all new incoming requests!
m_aTransactionManager
.
setWorkingMode
(
E_BEFORECLOSE
);
aWriteLock
.
unlock
();
// end synchronize
// 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.
...
@@ -1898,11 +1895,9 @@ void Desktop::impl_sendNotifyTerminationEvent()
...
@@ -1898,11 +1895,9 @@ void Desktop::impl_sendNotifyTerminationEvent()
//=============================================================================
//=============================================================================
::
sal_Bool
Desktop
::
impl_closeFrames
(
::
sal_Bool
bAllowUI
)
::
sal_Bool
Desktop
::
impl_closeFrames
(
::
sal_Bool
bAllowUI
)
{
{
SYNCHRONIZED_START
ReadGuard
aReadLock
(
m_aLock
);
// start synchronize
ReadGuard
aReadLock
(
m_aLock
);
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
.
unlock
();
SYNCHRONIZED_END
::
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