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
2eaa1422
Kaydet (Commit)
2eaa1422
authored
Şub 23, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adapted AsyncEventNotifier to safer-to-use salhelper::Thread
üst
40d21ab3
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
46 additions
and
66 deletions
+46
-66
Library_comphelp.mk
comphelper/Library_comphelp.mk
+3
-2
asyncnotification.hxx
comphelper/inc/comphelper/asyncnotification.hxx
+15
-18
build.lst
comphelper/prj/build.lst
+1
-1
asyncnotification.cxx
comphelper/source/misc/asyncnotification.cxx
+3
-34
documenteventnotifier.cxx
dbaccess/source/core/dataaccess/documenteventnotifier.cxx
+5
-4
Library_pcr.mk
extensions/Library_pcr.mk
+1
-0
build.lst
extensions/prj/build.lst
+1
-1
browserlistbox.cxx
extensions/source/propctrlr/browserlistbox.cxx
+7
-2
Library_frm.mk
forms/Library_frm.mk
+1
-0
build.lst
forms/prj/build.lst
+1
-1
ListBox.cxx
forms/source/component/ListBox.cxx
+8
-3
No files found.
comphelper/Library_comphelp.mk
Dosyayı görüntüle @
2eaa1422
...
@@ -42,9 +42,10 @@ $(eval $(call gb_Library_add_defs,comphelper,\
...
@@ -42,9 +42,10 @@ $(eval $(call gb_Library_add_defs,comphelper,\
))
))
$(eval $(call gb_Library_add_linked_libs,comphelper,\
$(eval $(call gb_Library_add_linked_libs,comphelper,\
sal \
cppuhelper \
cppu \
cppu \
cppuhelper \
sal \
salhelper \
ucbhelper \
ucbhelper \
$(gb_STDLIBS) \
$(gb_STDLIBS) \
))
))
...
...
comphelper/inc/comphelper/asyncnotification.hxx
Dosyayı görüntüle @
2eaa1422
...
@@ -29,12 +29,13 @@
...
@@ -29,12 +29,13 @@
#ifndef COMPHELPER_ASYNCNOTIFICATION_HXX
#ifndef COMPHELPER_ASYNCNOTIFICATION_HXX
#define COMPHELPER_ASYNCNOTIFICATION_HXX
#define COMPHELPER_ASYNCNOTIFICATION_HXX
#include <osl/thread.hxx>
#include "sal/config.h"
#include <rtl/ref.hxx>
#include <comphelper/comphelperdllapi.h>
#include <rtl/alloc.h>
#include <memory>
#include "boost/scoped_ptr.hpp"
#include "comphelper/comphelperdllapi.h"
#include "rtl/ref.hxx"
#include "sal/types.h"
#include "salhelper/thread.hxx"
//........................................................................
//........................................................................
namespace
comphelper
namespace
comphelper
...
@@ -109,26 +110,25 @@ namespace comphelper
...
@@ -109,26 +110,25 @@ namespace comphelper
events in the queue. As soon as you add an event, the thread is woken up, processes the event,
events in the queue. As soon as you add an event, the thread is woken up, processes the event,
and sleeps again.
and sleeps again.
*/
*/
class
COMPHELPER_DLLPUBLIC
AsyncEventNotifier
:
public
::
osl
::
Thread
class
COMPHELPER_DLLPUBLIC
AsyncEventNotifier
:
public
salhelper
::
Thread
,
public
::
rtl
::
IReference
{
{
friend
struct
EventNotifierImpl
;
friend
struct
EventNotifierImpl
;
private
:
private
:
::
std
::
auto_ptr
<
EventNotifierImpl
>
m_pImpl
;
boost
::
scoped_ptr
<
EventNotifierImpl
>
m_pImpl
;
SAL_DLLPRIVATE
virtual
~
AsyncEventNotifier
();
// Thread
// Thread
virtual
void
SAL_CALL
run
();
SAL_DLLPRIVATE
virtual
void
execute
();
virtual
void
SAL_CALL
onTerminated
();
public
:
public
:
/** constructs a notifier thread
/** constructs a notifier thread
*/
AsyncEventNotifier
();
// IReference implementations
@param name the thread name, see ::osl_setThreadName; must not be
virtual
oslInterlockedCount
SAL_CALL
acquire
();
null
virtual
oslInterlockedCount
SAL_CALL
release
();
*/
AsyncEventNotifier
(
char
const
*
name
);
/** terminates the thread
/** terminates the thread
...
@@ -156,9 +156,6 @@ namespace comphelper
...
@@ -156,9 +156,6 @@ namespace comphelper
/** removes all events for the given event processor from the queue
/** removes all events for the given event processor from the queue
*/
*/
void
removeEventsForProcessor
(
const
::
rtl
::
Reference
<
IEventProcessor
>&
_xProcessor
);
void
removeEventsForProcessor
(
const
::
rtl
::
Reference
<
IEventProcessor
>&
_xProcessor
);
protected
:
virtual
~
AsyncEventNotifier
();
};
};
//====================================================================
//====================================================================
...
...
comphelper/prj/build.lst
Dosyayı görüntüle @
2eaa1422
ph comphelper :
cppuhelper ucbhelper offapi officecfg salhelper LIBXSLT:libxslt NULL
ch comphelper : BOOST:boost
cppuhelper ucbhelper offapi officecfg salhelper LIBXSLT:libxslt NULL
ch comphelper\prj nmake - all ch_all NULL
ch comphelper\prj nmake - all ch_all NULL
comphelper/source/misc/asyncnotification.cxx
Dosyayı görüntüle @
2eaa1422
...
@@ -142,8 +142,8 @@ namespace comphelper
...
@@ -142,8 +142,8 @@ namespace comphelper
//= AsyncEventNotifier
//= AsyncEventNotifier
//====================================================================
//====================================================================
//--------------------------------------------------------------------
//--------------------------------------------------------------------
AsyncEventNotifier
::
AsyncEventNotifier
(
)
AsyncEventNotifier
::
AsyncEventNotifier
(
char
const
*
name
)
:
:
m_pImpl
(
new
EventNotifierImpl
)
Thread
(
name
),
m_pImpl
(
new
EventNotifierImpl
)
{
{
}
}
...
@@ -191,13 +191,8 @@ namespace comphelper
...
@@ -191,13 +191,8 @@ namespace comphelper
}
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
void
AsyncEventNotifier
::
run
()
void
AsyncEventNotifier
::
execute
()
{
{
acquire
();
// keep us alive, in case we're terminated in the mid of the following
::
rtl
::
Reference
<
AsyncEventNotifier
>
xKeepAlive
(
this
);
do
do
{
{
AnyEventRef
aNextEvent
;
AnyEventRef
aNextEvent
;
...
@@ -248,32 +243,6 @@ namespace comphelper
...
@@ -248,32 +243,6 @@ namespace comphelper
while
(
sal_True
);
while
(
sal_True
);
}
}
//--------------------------------------------------------------------
void
SAL_CALL
AsyncEventNotifier
::
onTerminated
()
{
Thread
::
onTerminated
();
// when we were started (->run), we aquired ourself. Release this now
// that we were finally terminated
release
();
}
//--------------------------------------------------------------------
oslInterlockedCount
SAL_CALL
AsyncEventNotifier
::
acquire
()
{
return
osl_incrementInterlockedCount
(
&
m_pImpl
->
m_refCount
);
}
//--------------------------------------------------------------------
oslInterlockedCount
SAL_CALL
AsyncEventNotifier
::
release
()
{
if
(
0
==
osl_decrementInterlockedCount
(
&
m_pImpl
->
m_refCount
)
)
{
delete
this
;
return
0
;
}
return
m_pImpl
->
m_refCount
;
}
//........................................................................
//........................................................................
}
// namespace comphelper
}
// namespace comphelper
//........................................................................
//........................................................................
...
...
dbaccess/source/core/dataaccess/documenteventnotifier.cxx
Dosyayı görüntüle @
2eaa1422
...
@@ -166,7 +166,7 @@ namespace dbaccess
...
@@ -166,7 +166,7 @@ namespace dbaccess
m_pEventBroadcaster
->
removeEventsForProcessor
(
this
);
m_pEventBroadcaster
->
removeEventsForProcessor
(
this
);
m_pEventBroadcaster
->
terminate
();
m_pEventBroadcaster
->
terminate
();
m_pEventBroadcaster
->
join
();
m_pEventBroadcaster
->
join
();
m_pEventBroadcaster
=
NULL
;
m_pEventBroadcaster
.
clear
()
;
}
}
lang
::
EventObject
aEvent
(
m_rDocument
);
lang
::
EventObject
aEvent
(
m_rDocument
);
...
@@ -190,7 +190,7 @@ namespace dbaccess
...
@@ -190,7 +190,7 @@ namespace dbaccess
m_bInitialized
=
true
;
m_bInitialized
=
true
;
if
(
m_pEventBroadcaster
.
is
()
)
if
(
m_pEventBroadcaster
.
is
()
)
// there are already pending asynchronous events
// there are already pending asynchronous events
m_pEventBroadcaster
->
create
();
m_pEventBroadcaster
->
launch
();
}
}
void
DocumentEventNotifier_Impl
::
impl_notifyEvent_nothrow
(
const
DocumentEvent
&
_rEvent
)
void
DocumentEventNotifier_Impl
::
impl_notifyEvent_nothrow
(
const
DocumentEvent
&
_rEvent
)
...
@@ -220,11 +220,12 @@ namespace dbaccess
...
@@ -220,11 +220,12 @@ namespace dbaccess
{
{
if
(
!
m_pEventBroadcaster
.
is
()
)
if
(
!
m_pEventBroadcaster
.
is
()
)
{
{
m_pEventBroadcaster
.
set
(
new
::
comphelper
::
AsyncEventNotifier
);
m_pEventBroadcaster
.
set
(
new
::
comphelper
::
AsyncEventNotifier
(
"DocumentEventNotifier"
));
if
(
m_bInitialized
)
if
(
m_bInitialized
)
// start processing the events if and only if we (our document, respectively) are
// start processing the events if and only if we (our document, respectively) are
// already initialized
// already initialized
m_pEventBroadcaster
->
create
();
m_pEventBroadcaster
->
launch
();
}
}
m_pEventBroadcaster
->
addEvent
(
new
DocumentEventHolder
(
_rEvent
),
this
);
m_pEventBroadcaster
->
addEvent
(
new
DocumentEventHolder
(
_rEvent
),
this
);
}
}
...
...
extensions/Library_pcr.mk
Dosyayı görüntüle @
2eaa1422
...
@@ -57,6 +57,7 @@ $(eval $(call gb_Library_add_linked_libs,pcr,\
...
@@ -57,6 +57,7 @@ $(eval $(call gb_Library_add_linked_libs,pcr,\
cppuhelper
\
cppuhelper
\
cppu
\
cppu
\
sal
\
sal
\
salhelper
\
$(gb_STDLIBS)
\
$(gb_STDLIBS)
\
))
))
...
...
extensions/prj/build.lst
Dosyayı görüntüle @
2eaa1422
ex extensions : officecfg TRANSLATIONS:translations DESKTOP:rdbmaker svx SANE:sane TWAIN:twain np_sdk offapi stoc ZLIB:zlib CURL:curl LIBXSLT:libxslt CPPUNIT:cppunit NULL
ex extensions : officecfg
salhelper
TRANSLATIONS:translations DESKTOP:rdbmaker svx SANE:sane TWAIN:twain np_sdk offapi stoc ZLIB:zlib CURL:curl LIBXSLT:libxslt CPPUNIT:cppunit NULL
ex extensions\prj nmake - all ex_prj NULL
ex extensions\prj nmake - all ex_prj NULL
# Fails at the moment
# Fails at the moment
...
...
extensions/source/propctrlr/browserlistbox.cxx
Dosyayı görüntüle @
2eaa1422
...
@@ -126,8 +126,13 @@ namespace pcr
...
@@ -126,8 +126,13 @@ namespace pcr
::
osl
::
MutexGuard
aGuard
(
getMutex
()
);
::
osl
::
MutexGuard
aGuard
(
getMutex
()
);
if
(
!
s_pNotifier
.
is
()
)
if
(
!
s_pNotifier
.
is
()
)
{
{
s_pNotifier
.
set
(
new
::
comphelper
::
AsyncEventNotifier
);
s_pNotifier
.
set
(
s_pNotifier
->
create
();
new
::
comphelper
::
AsyncEventNotifier
(
"browserlistbox"
));
s_pNotifier
->
launch
();
//TODO: a protocol is missing how to join with the launched
// thread before exit(3), to ensure the thread is no longer
// relying on any infrastructure while that infrastructure is
// being shut down in atexit handlers
}
}
return
s_pNotifier
;
return
s_pNotifier
;
}
}
...
...
forms/Library_frm.mk
Dosyayı görüntüle @
2eaa1422
...
@@ -47,6 +47,7 @@ $(eval $(call gb_Library_add_linked_libs,frm,\
...
@@ -47,6 +47,7 @@ $(eval $(call gb_Library_add_linked_libs,frm,\
editeng \
editeng \
i18nisolang1 \
i18nisolang1 \
sal \
sal \
salhelper \
sfx \
sfx \
svl \
svl \
svt \
svt \
...
...
forms/prj/build.lst
Dosyayı görüntüle @
2eaa1422
fm forms : TRANSLATIONS:translations oovbaapi svx sfx2 QADEVOOO:qadevOOo LIBXSLT:libxslt NULL
fm forms : TRANSLATIONS:translations oovbaapi s
alhelper s
vx sfx2 QADEVOOO:qadevOOo LIBXSLT:libxslt NULL
fm forms usr1 - all fm_mkofrm NULL
fm forms usr1 - all fm_mkofrm NULL
fm forms\prj nmake - all fm_prj NULL
fm forms\prj nmake - all fm_prj NULL
forms/source/component/ListBox.cxx
Dosyayı görüntüle @
2eaa1422
...
@@ -1528,7 +1528,6 @@ namespace frm
...
@@ -1528,7 +1528,6 @@ namespace frm
:
OBoundControl
(
_rxFactory
,
VCL_CONTROL_LISTBOX
,
sal_False
)
:
OBoundControl
(
_rxFactory
,
VCL_CONTROL_LISTBOX
,
sal_False
)
,
m_aChangeListeners
(
m_aMutex
)
,
m_aChangeListeners
(
m_aMutex
)
,
m_aItemListeners
(
m_aMutex
)
,
m_aItemListeners
(
m_aMutex
)
,
m_pItemBroadcaster
(
NULL
)
{
{
DBG_CTOR
(
OListBoxControl
,
NULL
);
DBG_CTOR
(
OListBoxControl
,
NULL
);
...
@@ -1614,8 +1613,9 @@ namespace frm
...
@@ -1614,8 +1613,9 @@ namespace frm
{
{
if
(
!
m_pItemBroadcaster
.
is
()
)
if
(
!
m_pItemBroadcaster
.
is
()
)
{
{
m_pItemBroadcaster
.
set
(
new
::
comphelper
::
AsyncEventNotifier
);
m_pItemBroadcaster
.
set
(
m_pItemBroadcaster
->
create
();
new
::
comphelper
::
AsyncEventNotifier
(
"ListBox"
));
m_pItemBroadcaster
->
launch
();
}
}
m_pItemBroadcaster
->
addEvent
(
new
ItemEventDescription
(
_rEvent
),
this
);
m_pItemBroadcaster
->
addEvent
(
new
ItemEventDescription
(
_rEvent
),
this
);
}
}
...
@@ -1701,15 +1701,20 @@ namespace frm
...
@@ -1701,15 +1701,20 @@ namespace frm
m_aChangeListeners
.
disposeAndClear
(
aEvent
);
m_aChangeListeners
.
disposeAndClear
(
aEvent
);
m_aItemListeners
.
disposeAndClear
(
aEvent
);
m_aItemListeners
.
disposeAndClear
(
aEvent
);
rtl
::
Reference
<
comphelper
::
AsyncEventNotifier
>
t
;
{
{
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
if
(
m_pItemBroadcaster
.
is
()
)
if
(
m_pItemBroadcaster
.
is
()
)
{
{
t
=
m_pItemBroadcaster
;
m_pItemBroadcaster
->
removeEventsForProcessor
(
this
);
m_pItemBroadcaster
->
removeEventsForProcessor
(
this
);
m_pItemBroadcaster
->
terminate
();
m_pItemBroadcaster
->
terminate
();
m_pItemBroadcaster
=
NULL
;
m_pItemBroadcaster
=
NULL
;
}
}
}
}
if
(
t
.
is
())
{
t
->
join
();
}
OBoundControl
::
disposing
();
OBoundControl
::
disposing
();
}
}
...
...
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