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
f7afe3b7
Kaydet (Commit)
f7afe3b7
authored
Şub 23, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adapted TickerThread to safer-to-use salhelper::Thread
üst
123c5934
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
NeonLockStore.cxx
ucb/source/ucp/webdav/NeonLockStore.cxx
+13
-13
NeonLockStore.hxx
ucb/source/ucp/webdav/NeonLockStore.hxx
+1
-1
No files found.
ucb/source/ucp/webdav/NeonLockStore.cxx
Dosyayı görüntüle @
f7afe3b7
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "rtl/ustring.hxx"
#include "rtl/ustring.hxx"
#include "osl/time.h"
#include "osl/time.h"
#include "osl/thread.hxx"
#include "osl/thread.hxx"
#include "salhelper/thread.hxx"
#include "NeonSession.hxx"
#include "NeonSession.hxx"
#include "NeonLockStore.hxx"
#include "NeonLockStore.hxx"
...
@@ -39,7 +40,7 @@ using namespace webdav_ucp;
...
@@ -39,7 +40,7 @@ using namespace webdav_ucp;
namespace
webdav_ucp
{
namespace
webdav_ucp
{
class
TickerThread
:
public
osl
::
Thread
class
TickerThread
:
public
salhelper
::
Thread
{
{
bool
m_bFinish
;
bool
m_bFinish
;
NeonLockStore
&
m_rLockStore
;
NeonLockStore
&
m_rLockStore
;
...
@@ -47,19 +48,20 @@ class TickerThread : public osl::Thread
...
@@ -47,19 +48,20 @@ class TickerThread : public osl::Thread
public
:
public
:
TickerThread
(
NeonLockStore
&
rLockStore
)
TickerThread
(
NeonLockStore
&
rLockStore
)
:
osl
::
Thread
(),
m_bFinish
(
false
),
m_rLockStore
(
rLockStore
)
{}
:
Thread
(
"NeonTickerThread"
),
m_bFinish
(
false
),
m_rLockStore
(
rLockStore
)
{}
void
finish
()
{
m_bFinish
=
true
;
}
void
finish
()
{
m_bFinish
=
true
;
}
pr
otected
:
pr
ivate
:
virtual
void
SAL_CALL
run
();
virtual
void
execute
();
};
};
}
// namespace webdav_ucp
}
// namespace webdav_ucp
// -------------------------------------------------------------------
// -------------------------------------------------------------------
void
TickerThread
::
run
()
void
TickerThread
::
execute
()
{
{
OSL_TRACE
(
"TickerThread: start."
);
OSL_TRACE
(
"TickerThread: start."
);
...
@@ -78,7 +80,7 @@ void TickerThread::run()
...
@@ -78,7 +80,7 @@ void TickerThread::run()
TimeValue
aTV
;
TimeValue
aTV
;
aTV
.
Seconds
=
0
;
aTV
.
Seconds
=
0
;
aTV
.
Nanosec
=
1000000000
/
nNth
;
aTV
.
Nanosec
=
1000000000
/
nNth
;
wait
(
aTV
);
osl
::
Thread
::
wait
(
aTV
);
}
}
OSL_TRACE
(
"TickerThread: stop."
);
OSL_TRACE
(
"TickerThread: stop."
);
...
@@ -86,8 +88,7 @@ void TickerThread::run()
...
@@ -86,8 +88,7 @@ void TickerThread::run()
// -------------------------------------------------------------------
// -------------------------------------------------------------------
NeonLockStore
::
NeonLockStore
()
NeonLockStore
::
NeonLockStore
()
:
m_pNeonLockStore
(
ne_lockstore_create
()
),
:
m_pNeonLockStore
(
ne_lockstore_create
()
)
m_pTickerThread
(
0
)
{
{
OSL_ENSURE
(
m_pNeonLockStore
,
"Unable to create neon lock store!"
);
OSL_ENSURE
(
m_pNeonLockStore
,
"Unable to create neon lock store!"
);
}
}
...
@@ -122,10 +123,10 @@ void NeonLockStore::startTicker()
...
@@ -122,10 +123,10 @@ void NeonLockStore::startTicker()
{
{
osl
::
MutexGuard
aGuard
(
m_aMutex
);
osl
::
MutexGuard
aGuard
(
m_aMutex
);
if
(
!
m_pTickerThread
)
if
(
!
m_pTickerThread
.
is
()
)
{
{
m_pTickerThread
=
new
TickerThread
(
*
this
);
m_pTickerThread
=
new
TickerThread
(
*
this
);
m_pTickerThread
->
create
();
m_pTickerThread
->
launch
();
}
}
}
}
...
@@ -134,12 +135,11 @@ void NeonLockStore::stopTicker()
...
@@ -134,12 +135,11 @@ void NeonLockStore::stopTicker()
{
{
osl
::
MutexGuard
aGuard
(
m_aMutex
);
osl
::
MutexGuard
aGuard
(
m_aMutex
);
if
(
m_pTickerThread
)
if
(
m_pTickerThread
.
is
()
)
{
{
m_pTickerThread
->
finish
();
m_pTickerThread
->
finish
();
m_pTickerThread
->
join
();
m_pTickerThread
->
join
();
delete
m_pTickerThread
;
m_pTickerThread
.
clear
();
m_pTickerThread
=
0
;
}
}
}
}
...
...
ucb/source/ucp/webdav/NeonLockStore.hxx
Dosyayı görüntüle @
f7afe3b7
...
@@ -69,7 +69,7 @@ class NeonLockStore
...
@@ -69,7 +69,7 @@ class NeonLockStore
{
{
osl
::
Mutex
m_aMutex
;
osl
::
Mutex
m_aMutex
;
ne_lock_store
*
m_pNeonLockStore
;
ne_lock_store
*
m_pNeonLockStore
;
TickerThread
*
m_pTickerThread
;
rtl
::
Reference
<
TickerThread
>
m_pTickerThread
;
LockInfoMap
m_aLockInfoMap
;
LockInfoMap
m_aLockInfoMap
;
public
:
public
:
...
...
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