Kaydet (Commit) 73fc75bf authored tarafından Caolán McNamara's avatar Caolán McNamara

ditch SYNCHRONIZED_START/END

Change-Id: I1c0c015f371346efc5712ead7abe9e7f2ec0f9d0
üst 9e44e1a8
...@@ -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: */
...@@ -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 );
......
...@@ -271,8 +271,7 @@ sal_Bool SAL_CALL Desktop::terminate() ...@@ -271,8 +271,7 @@ 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;
...@@ -282,8 +281,7 @@ sal_Bool SAL_CALL Desktop::terminate() ...@@ -282,8 +281,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(); 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,8 +1177,8 @@ void SAL_CALL Desktop::dispose() ...@@ -1179,8 +1177,8 @@ 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 ); WriteGuard aWriteLock( m_aLock ); // start synchronize
// Look for multiple calls of this method! // Look for multiple calls of this method!
// If somewhere call dispose() twice - he will be stopped here realy!!! // If somewhere call dispose() twice - he will be stopped here realy!!!
...@@ -1201,8 +1199,7 @@ void SAL_CALL Desktop::dispose() ...@@ -1201,8 +1199,7 @@ void SAL_CALL Desktop::dispose()
// and reject all new incoming requests! // and reject all new incoming requests!
m_aTransactionManager.setWorkingMode( E_BEFORECLOSE ); m_aTransactionManager.setWorkingMode( E_BEFORECLOSE );
aWriteLock.unlock(); aWriteLock.unlock(); // end synchronize
SYNCHRONIZED_END
// 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(); aReadLock.unlock(); // end synchronize
SYNCHRONIZED_END
::sal_Int32 c = lFrames.getLength(); ::sal_Int32 c = lFrames.getLength();
::sal_Int32 i = 0; ::sal_Int32 i = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment