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
3f1d1539
Kaydet (Commit)
3f1d1539
authored
Mar 20, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use an osl::Mutex directly
Change-Id: I3df1bcd733637db8d967809e9abb0d2775d58efb
üst
9baa3cf7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
21 deletions
+11
-21
loaddispatcher.hxx
framework/source/inc/dispatch/loaddispatcher.hxx
+1
-0
actionlockguard.hxx
framework/source/inc/loadenv/actionlockguard.hxx
+9
-21
frame.cxx
framework/source/services/frame.cxx
+1
-0
No files found.
framework/source/inc/dispatch/loaddispatcher.hxx
Dosyayı görüntüle @
3f1d1539
...
...
@@ -21,6 +21,7 @@
#define INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_LOADDISPATCHER_HXX
#include <loadenv/loadenv.hxx>
#include <threadhelp/threadhelpbase.hxx>
#include <com/sun/star/frame/XNotifyingDispatch.hpp>
#include <com/sun/star/frame/XSynchronousDispatch.hpp>
...
...
framework/source/inc/loadenv/actionlockguard.hxx
Dosyayı görüntüle @
3f1d1539
...
...
@@ -21,9 +21,6 @@
#define INCLUDED_FRAMEWORK_SOURCE_INC_LOADENV_ACTIONLOCKGUARD_HXX
#include <threadhelp/threadhelpbase.hxx>
#include <threadhelp/guard.hxx>
#include <com/sun/star/document/XActionLockable.hpp>
...
...
@@ -35,12 +32,13 @@ namespace framework{
@descr This guard should be used to be shure, that any lock will be
released. Otherwise the locaked document can hinder the office on shutdown!
*/
class
ActionLockGuard
:
private
ThreadHelpBase
class
ActionLockGuard
{
// member
private
:
osl
::
Mutex
m_mutex
;
/** @short points to the object, which can be locked from outside. */
css
::
uno
::
Reference
<
css
::
document
::
XActionLockable
>
m_xActionLock
;
...
...
@@ -62,8 +60,7 @@ class ActionLockGuard : private ThreadHelpBase
in a mode "use guard for more then one resources".
*/
ActionLockGuard
()
:
ThreadHelpBase
(
)
,
m_bActionLocked
(
sal_False
)
:
m_bActionLocked
(
sal_False
)
{
}
...
...
@@ -74,8 +71,7 @@ class ActionLockGuard : private ThreadHelpBase
points to the outside resource, which should be locked.
*/
ActionLockGuard
(
const
css
::
uno
::
Reference
<
css
::
document
::
XActionLockable
>&
xLock
)
:
ThreadHelpBase
(
)
,
m_bActionLocked
(
sal_False
)
:
m_bActionLocked
(
sal_False
)
{
setResource
(
xLock
);
}
...
...
@@ -103,8 +99,7 @@ class ActionLockGuard : private ThreadHelpBase
*/
virtual
sal_Bool
setResource
(
const
css
::
uno
::
Reference
<
css
::
document
::
XActionLockable
>&
xLock
)
{
// SAFE -> ..........................
Guard
aMutexLock
(
m_aLock
);
osl
::
MutexGuard
g
(
m_mutex
);
if
(
m_bActionLocked
||
!
xLock
.
is
())
return
sal_False
;
...
...
@@ -112,7 +107,6 @@ class ActionLockGuard : private ThreadHelpBase
m_xActionLock
=
xLock
;
m_xActionLock
->
addActionLock
();
m_bActionLocked
=
m_xActionLock
->
isActionLocked
();
// <- SAFE ..........................
return
sal_True
;
}
...
...
@@ -132,7 +126,7 @@ class ActionLockGuard : private ThreadHelpBase
virtual
void
freeResource
()
{
// SAFE -> ..........................
Guard
aMutexLock
(
m_aLock
);
osl
::
ClearableMutexGuard
aMutexLock
(
m_mutex
);
css
::
uno
::
Reference
<
css
::
document
::
XActionLockable
>
xLock
=
m_xActionLock
;
sal_Bool
bLocked
=
m_bActionLocked
;
...
...
@@ -140,7 +134,7 @@ class ActionLockGuard : private ThreadHelpBase
m_xActionLock
.
clear
();
m_bActionLocked
=
sal_False
;
aMutexLock
.
unlock
();
aMutexLock
.
clear
();
// <- SAFE ..........................
if
(
bLocked
&&
xLock
.
is
())
...
...
@@ -151,24 +145,19 @@ class ActionLockGuard : private ThreadHelpBase
/** @short lock the internal wrapped resource, if its not already done. */
virtual
void
lock
()
{
// SAFE -> ..........................
Guard
aMutexLock
(
m_aLock
);
osl
::
MutexGuard
g
(
m_mutex
);
if
(
!
m_bActionLocked
&&
m_xActionLock
.
is
())
{
m_xActionLock
->
addActionLock
();
m_bActionLocked
=
m_xActionLock
->
isActionLocked
();
}
// <- SAFE ..........................
}
/** @short unlock the internal wrapped resource, if its not already done. */
virtual
void
unlock
()
{
// SAFE -> ..........................
Guard
aMutexLock
(
m_aLock
);
osl
::
MutexGuard
g
(
m_mutex
);
if
(
m_bActionLocked
&&
m_xActionLock
.
is
())
{
m_xActionLock
->
removeActionLock
();
...
...
@@ -176,7 +165,6 @@ class ActionLockGuard : private ThreadHelpBase
// May another guard use the same lock object :-(
m_bActionLocked
=
sal_False
;
}
// <- SAFE ..........................
}
};
...
...
framework/source/services/frame.cxx
Dosyayı görüntüle @
3f1d1539
...
...
@@ -32,6 +32,7 @@
#include <dispatch/dispatchinformationprovider.hxx>
#include <classes/framecontainer.hxx>
#include <classes/propertysethelper.hxx>
#include <threadhelp/guard.hxx>
#include <threadhelp/transactionguard.hxx>
#include <threadhelp/transactionbase.hxx>
#include <general.h>
...
...
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