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
d21fb145
Kaydet (Commit)
d21fb145
authored
Şub 23, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adapted Reader/Writer to safer-to-use salhelper::Thread
üst
0a5dcfe4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
54 deletions
+16
-54
bridge.cxx
binaryurp/source/bridge.cxx
+3
-3
reader.cxx
binaryurp/source/reader.cxx
+4
-8
reader.hxx
binaryurp/source/reader.hxx
+3
-18
writer.cxx
binaryurp/source/writer.cxx
+3
-8
writer.hxx
binaryurp/source/writer.hxx
+3
-17
No files found.
binaryurp/source/bridge.cxx
Dosyayı görüntüle @
d21fb145
...
...
@@ -106,7 +106,7 @@ extern "C" void SAL_CALL freeProxyCallback(
static_cast
<
Proxy
*
>
(
pProxy
)
->
do_free
();
}
void
joinThread
(
osl
::
Thread
*
thread
)
{
void
joinThread
(
salhelper
::
Thread
*
thread
)
{
assert
(
thread
!=
0
);
if
(
thread
->
getIdentifier
()
!=
osl
::
Thread
::
getCurrentIdentifier
())
{
thread
->
join
();
...
...
@@ -239,9 +239,9 @@ void Bridge::start() {
threadPool_
=
uno_threadpool_create
();
assert
(
threadPool_
!=
0
);
writer_
.
set
(
new
Writer
(
this
));
writer_
->
create
();
writer_
->
launch
();
reader_
.
set
(
new
Reader
(
this
));
reader_
->
create
();
reader_
->
launch
();
}
void
Bridge
::
terminate
()
{
...
...
binaryurp/source/reader.cxx
Dosyayı görüntüle @
d21fb145
...
...
@@ -109,15 +109,15 @@ extern "C" void SAL_CALL request(void * pThreadSpecificData) {
}
Reader
::
Reader
(
rtl
::
Reference
<
Bridge
>
const
&
bridge
)
:
bridge_
(
bridge
)
{
Reader
::
Reader
(
rtl
::
Reference
<
Bridge
>
const
&
bridge
)
:
Thread
(
"binaryurpReader"
),
bridge_
(
bridge
)
{
assert
(
bridge
.
is
());
acquire
();
}
Reader
::~
Reader
()
{}
void
Reader
::
run
()
{
setName
(
"binaryurpReader"
);
void
Reader
::
execute
()
{
try
{
bridge_
->
sendRequestChangeRequest
();
css
::
uno
::
Reference
<
css
::
connection
::
XConnection
>
con
(
...
...
@@ -153,10 +153,6 @@ void Reader::run() {
bridge_
->
terminate
();
}
void
Reader
::
onTerminated
()
{
release
();
}
void
Reader
::
readMessage
(
Unmarshal
&
unmarshal
)
{
sal_uInt8
flags1
=
unmarshal
.
read8
();
bool
newType
;
...
...
binaryurp/source/reader.hxx
Dosyayı görüntüle @
d21fb145
...
...
@@ -31,15 +31,11 @@
#include "sal/config.h"
#include <cstddef>
#include "boost/noncopyable.hpp"
#include "osl/thread.hxx"
#include "rtl/byteseq.hxx"
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "salhelper/
simplereferenceobject
.hxx"
#include "salhelper/
thread
.hxx"
#include "typelib/typedescription.hxx"
#include "readerstate.hxx"
...
...
@@ -52,25 +48,14 @@ namespace binaryurp {
namespace
binaryurp
{
class
Reader
:
public
osl
::
Thread
,
public
salhelper
::
SimpleReferenceObject
,
private
boost
::
noncopyable
{
class
Reader
:
public
salhelper
::
Thread
{
public
:
static
void
*
operator
new
(
std
::
size_t
size
)
{
return
Thread
::
operator
new
(
size
);
}
static
void
operator
delete
(
void
*
pointer
)
{
Thread
::
operator
delete
(
pointer
);
}
explicit
Reader
(
rtl
::
Reference
<
Bridge
>
const
&
bridge
);
private
:
virtual
~
Reader
();
virtual
void
SAL_CALL
run
();
virtual
void
SAL_CALL
onTerminated
();
virtual
void
execute
();
void
readMessage
(
Unmarshal
&
unmarshal
);
...
...
binaryurp/source/writer.cxx
Dosyayı görüntüle @
d21fb145
...
...
@@ -77,10 +77,10 @@ Writer::Item::Item(
{}
Writer
::
Writer
(
rtl
::
Reference
<
Bridge
>
const
&
bridge
)
:
bridge_
(
bridge
),
marshal_
(
bridge
,
state_
),
stop_
(
false
)
Thread
(
"binaryurpWriter"
),
bridge_
(
bridge
),
marshal_
(
bridge
,
state_
),
stop_
(
false
)
{
OSL_ASSERT
(
bridge
.
is
());
acquire
();
}
void
Writer
::
sendDirectRequest
(
...
...
@@ -148,8 +148,7 @@ void Writer::stop() {
Writer
::~
Writer
()
{}
void
Writer
::
run
()
{
setName
(
"binaryurpWriter"
);
void
Writer
::
execute
()
{
try
{
unblocked_
.
wait
();
for
(;;)
{
...
...
@@ -199,10 +198,6 @@ void Writer::run() {
bridge_
->
terminate
();
}
void
Writer
::
onTerminated
()
{
release
();
}
void
Writer
::
sendRequest
(
rtl
::
ByteSequence
const
&
tid
,
rtl
::
OUString
const
&
oid
,
css
::
uno
::
TypeDescription
const
&
type
,
...
...
binaryurp/source/writer.hxx
Dosyayı görüntüle @
d21fb145
...
...
@@ -31,19 +31,15 @@
#include "sal/config.h"
#include <cstddef>
#include <deque>
#include <vector>
#include "boost/noncopyable.hpp"
#include "osl/conditn.hxx"
#include "osl/mutex.hxx"
#include "osl/thread.hxx"
#include "rtl/byteseq.hxx"
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "salhelper/simplereferenceobject.hxx"
#include "salhelper/thread.hxx"
#include "typelib/typedescription.hxx"
#include "uno/dispatcher.hxx"
...
...
@@ -55,17 +51,9 @@ namespace binaryurp { class Bridge; }
namespace
binaryurp
{
class
Writer
:
public
osl
::
Thread
,
public
salhelper
::
SimpleReferenceObject
,
private
boost
::
noncopyable
class
Writer
:
public
salhelper
::
Thread
{
public
:
static
void
*
operator
new
(
std
::
size_t
size
)
{
return
Thread
::
operator
new
(
size
);
}
static
void
operator
delete
(
void
*
pointer
)
{
Thread
::
operator
delete
(
pointer
);
}
explicit
Writer
(
rtl
::
Reference
<
Bridge
>
const
&
bridge
);
// Only called from Bridge::reader_ thread, and only before Bridge::writer_
...
...
@@ -104,9 +92,7 @@ public:
private
:
virtual
~
Writer
();
virtual
void
SAL_CALL
run
();
virtual
void
SAL_CALL
onTerminated
();
virtual
void
execute
();
void
sendRequest
(
rtl
::
ByteSequence
const
&
tid
,
rtl
::
OUString
const
&
oid
,
...
...
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