2011-06-02 16:49:28 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 17:51:46 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
#ifndef INCLUDED_BINARYURP_SOURCE_BRIDGE_HXX
|
|
|
|
#define INCLUDED_BINARYURP_SOURCE_BRIDGE_HXX
|
|
|
|
|
|
|
|
#include "sal/config.h"
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
#include <list>
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "com/sun/star/bridge/XBridge.hpp"
|
|
|
|
#include "com/sun/star/lang/XComponent.hpp"
|
|
|
|
#include "com/sun/star/uno/Reference.hxx"
|
|
|
|
#include "com/sun/star/uno/RuntimeException.hpp"
|
|
|
|
#include "cppuhelper/implbase2.hxx"
|
|
|
|
#include "osl/conditn.hxx"
|
|
|
|
#include "osl/mutex.hxx"
|
|
|
|
#include "rtl/ref.hxx"
|
|
|
|
#include "rtl/ustring.hxx"
|
|
|
|
#include "sal/types.h"
|
|
|
|
#include "uno/environment.hxx"
|
|
|
|
#include "uno/mapping.hxx"
|
|
|
|
#include "uno/threadpool.h"
|
|
|
|
|
|
|
|
#include "outgoingrequest.hxx"
|
|
|
|
#include "outgoingrequests.hxx"
|
|
|
|
#include "writer.hxx"
|
|
|
|
|
|
|
|
namespace binaryurp {
|
|
|
|
class BinaryAny;
|
|
|
|
class BridgeFactory;
|
|
|
|
class Proxy;
|
|
|
|
class Reader;
|
|
|
|
}
|
|
|
|
namespace com { namespace sun { namespace star {
|
|
|
|
namespace bridge { class XInstanceProvider; }
|
|
|
|
namespace connection { class XConnection; }
|
|
|
|
namespace lang { class XEventListener; }
|
|
|
|
namespace uno {
|
|
|
|
class Any;
|
|
|
|
class TypeDescription;
|
|
|
|
class UnoInterfaceReference;
|
|
|
|
class XInterface;
|
|
|
|
}
|
|
|
|
} } }
|
|
|
|
namespace rtl { class ByteSequence; }
|
|
|
|
|
|
|
|
namespace binaryurp {
|
|
|
|
|
|
|
|
class Bridge:
|
|
|
|
public cppu::WeakImplHelper2<
|
2015-02-15 20:54:22 +00:00
|
|
|
com::sun::star::bridge::XBridge, com::sun::star::lang::XComponent >
|
2011-01-26 09:26:59 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
Bridge(
|
|
|
|
rtl::Reference< BridgeFactory > const & factory,
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString const & name,
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::Reference<
|
|
|
|
com::sun::star::connection::XConnection > const & connection,
|
|
|
|
com::sun::star::uno::Reference<
|
|
|
|
com::sun::star::bridge::XInstanceProvider > const & provider);
|
|
|
|
|
|
|
|
void start();
|
|
|
|
|
|
|
|
// Internally waits for all incoming and outgoing remote calls to terminate,
|
Better fix for ThreadPool/ORequestThread life cycle
This is a follow up to d015384e1d98fe77fd59339044f58efb1ab9fb25 "Fixed
ThreadPool (and dependent ORequestThread) life cycle" that still had some
problems:
* First, if Bridge::terminate was first entered from the reader or writer
thread, it would not join on that thread, so that thread could still be running
during exit.
That has been addressed by giving Bridge::dispose new semantics: It waits until
both Bridge::terminate has completed (even if that was called from a different
thread) and all spawned threads (reader, writer, ORequestThread workers) have
been joined. (This implies that Bridge::dispose must not be called from such a
thread, to avoid deadlock.)
* Second, if Bridge::terminate was first entered from an ORequestThread, the
call to uno_threadpool_dispose(0) to join on all such worker threads could
deadlock.
That has been addressed by making the last call to uno_threadpool_destroy wait
to join on all worker threads, and by calling uno_threadpool_destroy only from
the final Bridge::terminate (from Bridge::dispose), to avoid deadlock. (The
special semantics of uno_threadpool_dispose(0) are no longer needed and have
been removed, as they conflicted with the fix for the third problem below.)
* Third, once uno_threadpool_destroy had called uno_threadpool_dispose(0), the
ThreadAdmin singleton had been disposed, so no new remote bridges could
successfully be created afterwards.
That has been addressed by making ThreadAdmin a member of ThreadPool, and making
(only) those uno_ThreadPool handles with overlapping life spans share one
ThreadPool instance (which thus is no longer a singleton, either).
Additionally, ORequestThread has been made more robust (in the style of
salhelper::Thread) to avoid races.
Change-Id: I2cbd1b3f9aecc1bf4649e482d2c22b33b471788f
2012-05-23 09:42:37 +02:00
|
|
|
// so must not be called from within such a call; when final is true, also
|
|
|
|
// joins all remaining threads (reader, writer, and worker threads from the
|
|
|
|
// thread pool), so must not be called with final set to true from such a
|
|
|
|
// thread:
|
|
|
|
void terminate(bool final);
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::connection::XConnection >
|
2014-06-12 14:06:28 +02:00
|
|
|
getConnection() const { return connection_;}
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::bridge::XInstanceProvider >
|
2014-06-12 14:06:28 +02:00
|
|
|
getProvider() const { return provider_;}
|
2011-01-26 09:26:59 +01:00
|
|
|
|
2014-06-12 14:06:28 +02:00
|
|
|
com::sun::star::uno::Mapping & getCppToBinaryMapping() { return cppToBinaryMapping_;}
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
BinaryAny mapCppToBinaryAny(com::sun::star::uno::Any const & cppAny);
|
|
|
|
|
2012-05-16 22:09:21 +02:00
|
|
|
uno_ThreadPool getThreadPool();
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
rtl::Reference< Writer > getWriter();
|
|
|
|
|
|
|
|
com::sun::star::uno::UnoInterfaceReference registerIncomingInterface(
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString const & oid,
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::TypeDescription const & type);
|
|
|
|
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString registerOutgoingInterface(
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::UnoInterfaceReference const & object,
|
|
|
|
com::sun::star::uno::TypeDescription const & type);
|
|
|
|
|
|
|
|
com::sun::star::uno::UnoInterfaceReference findStub(
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString const & oid,
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::TypeDescription const & type);
|
|
|
|
|
|
|
|
void releaseStub(
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString const & oid,
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::TypeDescription const & type);
|
|
|
|
|
|
|
|
void resurrectProxy(Proxy & proxy);
|
|
|
|
|
|
|
|
void revokeProxy(Proxy & proxy);
|
|
|
|
|
|
|
|
void freeProxy(Proxy & proxy);
|
|
|
|
|
|
|
|
void incrementCalls(bool normalCall) throw ();
|
|
|
|
|
|
|
|
void decrementCalls();
|
|
|
|
|
|
|
|
void incrementActiveCalls() throw ();
|
|
|
|
|
|
|
|
void decrementActiveCalls() throw ();
|
|
|
|
|
|
|
|
bool makeCall(
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString const & oid,
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::TypeDescription const & member, bool setter,
|
|
|
|
std::vector< BinaryAny > const & inArguments, BinaryAny * returnValue,
|
|
|
|
std::vector< BinaryAny > * outArguments);
|
|
|
|
|
|
|
|
// Only called from reader_ thread:
|
|
|
|
void sendRequestChangeRequest();
|
|
|
|
|
|
|
|
// Only called from reader_ thread:
|
|
|
|
void handleRequestChangeReply(
|
|
|
|
bool exception, BinaryAny const & returnValue);
|
|
|
|
|
|
|
|
// Only called from reader_ thread:
|
|
|
|
void handleCommitChangeReply(bool exception, BinaryAny const & returnValue);
|
|
|
|
|
|
|
|
// Only called from reader_ thread:
|
|
|
|
void handleRequestChangeRequest(
|
|
|
|
rtl::ByteSequence const & tid,
|
|
|
|
std::vector< BinaryAny > const & inArguments);
|
|
|
|
|
|
|
|
// Only called from reader_ thread:
|
|
|
|
void handleCommitChangeRequest(
|
|
|
|
rtl::ByteSequence const & tid,
|
|
|
|
std::vector< BinaryAny > const & inArguments);
|
|
|
|
|
|
|
|
OutgoingRequest lastOutgoingRequest(rtl::ByteSequence const & tid);
|
|
|
|
|
|
|
|
bool isProtocolPropertiesRequest(
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString const & oid,
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::TypeDescription const & type) const;
|
|
|
|
|
|
|
|
void setCurrentContextMode();
|
|
|
|
|
|
|
|
bool isCurrentContextMode();
|
|
|
|
|
|
|
|
private:
|
2015-02-15 20:54:22 +00:00
|
|
|
Bridge(const Bridge&) SAL_DELETED_FUNCTION;
|
|
|
|
Bridge& operator=(const Bridge&) SAL_DELETED_FUNCTION;
|
|
|
|
|
2011-01-26 09:26:59 +01:00
|
|
|
virtual ~Bridge();
|
|
|
|
|
|
|
|
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
|
2012-08-18 15:05:22 -03:00
|
|
|
SAL_CALL getInstance(OUString const & sInstanceName)
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-01-26 09:26:59 +01:00
|
|
|
|
2012-08-18 15:05:22 -03:00
|
|
|
virtual OUString SAL_CALL getName()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-01-26 09:26:59 +01:00
|
|
|
|
2012-08-18 15:05:22 -03:00
|
|
|
virtual OUString SAL_CALL getDescription()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
virtual void SAL_CALL dispose()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
virtual void SAL_CALL addEventListener(
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
|
|
|
|
const & xListener)
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
virtual void SAL_CALL removeEventListener(
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
|
|
|
|
const & aListener)
|
2014-03-26 16:37:00 +01:00
|
|
|
throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
// Only called from reader_ thread:
|
|
|
|
void sendCommitChangeRequest();
|
|
|
|
|
|
|
|
// Only called from reader_ thread:
|
|
|
|
void sendProtPropRequest(
|
|
|
|
OutgoingRequest::Kind kind,
|
|
|
|
std::vector< BinaryAny > const & inArguments);
|
|
|
|
|
|
|
|
void makeReleaseCall(
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString const & oid,
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::TypeDescription const & type);
|
|
|
|
|
|
|
|
void sendRequest(
|
2012-08-18 15:05:22 -03:00
|
|
|
rtl::ByteSequence const & tid, OUString const & oid,
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::TypeDescription const & type,
|
|
|
|
com::sun::star::uno::TypeDescription const & member,
|
|
|
|
std::vector< BinaryAny > const & inArguments);
|
|
|
|
|
|
|
|
void throwException(bool exception, BinaryAny const & value);
|
|
|
|
|
|
|
|
com::sun::star::uno::Any mapBinaryToCppAny(BinaryAny const & binaryAny);
|
|
|
|
|
|
|
|
bool becameUnused() const;
|
|
|
|
|
|
|
|
void terminateWhenUnused(bool unused);
|
|
|
|
|
Better fix for ThreadPool/ORequestThread life cycle
This is a follow up to d015384e1d98fe77fd59339044f58efb1ab9fb25 "Fixed
ThreadPool (and dependent ORequestThread) life cycle" that still had some
problems:
* First, if Bridge::terminate was first entered from the reader or writer
thread, it would not join on that thread, so that thread could still be running
during exit.
That has been addressed by giving Bridge::dispose new semantics: It waits until
both Bridge::terminate has completed (even if that was called from a different
thread) and all spawned threads (reader, writer, ORequestThread workers) have
been joined. (This implies that Bridge::dispose must not be called from such a
thread, to avoid deadlock.)
* Second, if Bridge::terminate was first entered from an ORequestThread, the
call to uno_threadpool_dispose(0) to join on all such worker threads could
deadlock.
That has been addressed by making the last call to uno_threadpool_destroy wait
to join on all worker threads, and by calling uno_threadpool_destroy only from
the final Bridge::terminate (from Bridge::dispose), to avoid deadlock. (The
special semantics of uno_threadpool_dispose(0) are no longer needed and have
been removed, as they conflicted with the fix for the third problem below.)
* Third, once uno_threadpool_destroy had called uno_threadpool_dispose(0), the
ThreadAdmin singleton had been disposed, so no new remote bridges could
successfully be created afterwards.
That has been addressed by making ThreadAdmin a member of ThreadPool, and making
(only) those uno_ThreadPool handles with overlapping life spans share one
ThreadPool instance (which thus is no longer a singleton, either).
Additionally, ORequestThread has been made more robust (in the style of
salhelper::Thread) to avoid races.
Change-Id: I2cbd1b3f9aecc1bf4649e482d2c22b33b471788f
2012-05-23 09:42:37 +02:00
|
|
|
// Must only be called with mutex_ locked:
|
|
|
|
void checkDisposed();
|
|
|
|
|
2011-01-26 09:26:59 +01:00
|
|
|
typedef
|
|
|
|
std::list<
|
|
|
|
com::sun::star::uno::Reference<
|
|
|
|
com::sun::star::lang::XEventListener > >
|
|
|
|
Listeners;
|
|
|
|
|
|
|
|
struct SubStub;
|
|
|
|
|
|
|
|
typedef std::map< com::sun::star::uno::TypeDescription, SubStub > Stub;
|
|
|
|
|
2012-08-18 15:05:22 -03:00
|
|
|
typedef std::map< OUString, Stub > Stubs;
|
2011-01-26 09:26:59 +01:00
|
|
|
|
Better fix for ThreadPool/ORequestThread life cycle
This is a follow up to d015384e1d98fe77fd59339044f58efb1ab9fb25 "Fixed
ThreadPool (and dependent ORequestThread) life cycle" that still had some
problems:
* First, if Bridge::terminate was first entered from the reader or writer
thread, it would not join on that thread, so that thread could still be running
during exit.
That has been addressed by giving Bridge::dispose new semantics: It waits until
both Bridge::terminate has completed (even if that was called from a different
thread) and all spawned threads (reader, writer, ORequestThread workers) have
been joined. (This implies that Bridge::dispose must not be called from such a
thread, to avoid deadlock.)
* Second, if Bridge::terminate was first entered from an ORequestThread, the
call to uno_threadpool_dispose(0) to join on all such worker threads could
deadlock.
That has been addressed by making the last call to uno_threadpool_destroy wait
to join on all worker threads, and by calling uno_threadpool_destroy only from
the final Bridge::terminate (from Bridge::dispose), to avoid deadlock. (The
special semantics of uno_threadpool_dispose(0) are no longer needed and have
been removed, as they conflicted with the fix for the third problem below.)
* Third, once uno_threadpool_destroy had called uno_threadpool_dispose(0), the
ThreadAdmin singleton had been disposed, so no new remote bridges could
successfully be created afterwards.
That has been addressed by making ThreadAdmin a member of ThreadPool, and making
(only) those uno_ThreadPool handles with overlapping life spans share one
ThreadPool instance (which thus is no longer a singleton, either).
Additionally, ORequestThread has been made more robust (in the style of
salhelper::Thread) to avoid races.
Change-Id: I2cbd1b3f9aecc1bf4649e482d2c22b33b471788f
2012-05-23 09:42:37 +02:00
|
|
|
enum State { STATE_INITIAL, STATE_STARTED, STATE_TERMINATED, STATE_FINAL };
|
|
|
|
|
2011-01-26 09:26:59 +01:00
|
|
|
enum Mode {
|
|
|
|
MODE_REQUESTED, MODE_REPLY_MINUS1, MODE_REPLY_0, MODE_REPLY_1,
|
|
|
|
MODE_WAIT, MODE_NORMAL, MODE_NORMAL_WAIT };
|
|
|
|
|
|
|
|
rtl::Reference< BridgeFactory > factory_;
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString name_;
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::connection::XConnection >
|
|
|
|
connection_;
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::bridge::XInstanceProvider >
|
|
|
|
provider_;
|
|
|
|
com::sun::star::uno::Environment binaryUno_;
|
|
|
|
com::sun::star::uno::Mapping cppToBinaryMapping_;
|
|
|
|
com::sun::star::uno::Mapping binaryToCppMapping_;
|
|
|
|
rtl::ByteSequence protPropTid_;
|
2012-08-18 15:05:22 -03:00
|
|
|
OUString protPropOid_;
|
2011-01-26 09:26:59 +01:00
|
|
|
com::sun::star::uno::TypeDescription protPropType_;
|
|
|
|
com::sun::star::uno::TypeDescription protPropRequest_;
|
|
|
|
com::sun::star::uno::TypeDescription protPropCommit_;
|
|
|
|
OutgoingRequests outgoingRequests_;
|
Better fix for ThreadPool/ORequestThread life cycle
This is a follow up to d015384e1d98fe77fd59339044f58efb1ab9fb25 "Fixed
ThreadPool (and dependent ORequestThread) life cycle" that still had some
problems:
* First, if Bridge::terminate was first entered from the reader or writer
thread, it would not join on that thread, so that thread could still be running
during exit.
That has been addressed by giving Bridge::dispose new semantics: It waits until
both Bridge::terminate has completed (even if that was called from a different
thread) and all spawned threads (reader, writer, ORequestThread workers) have
been joined. (This implies that Bridge::dispose must not be called from such a
thread, to avoid deadlock.)
* Second, if Bridge::terminate was first entered from an ORequestThread, the
call to uno_threadpool_dispose(0) to join on all such worker threads could
deadlock.
That has been addressed by making the last call to uno_threadpool_destroy wait
to join on all worker threads, and by calling uno_threadpool_destroy only from
the final Bridge::terminate (from Bridge::dispose), to avoid deadlock. (The
special semantics of uno_threadpool_dispose(0) are no longer needed and have
been removed, as they conflicted with the fix for the third problem below.)
* Third, once uno_threadpool_destroy had called uno_threadpool_dispose(0), the
ThreadAdmin singleton had been disposed, so no new remote bridges could
successfully be created afterwards.
That has been addressed by making ThreadAdmin a member of ThreadPool, and making
(only) those uno_ThreadPool handles with overlapping life spans share one
ThreadPool instance (which thus is no longer a singleton, either).
Additionally, ORequestThread has been made more robust (in the style of
salhelper::Thread) to avoid races.
Change-Id: I2cbd1b3f9aecc1bf4649e482d2c22b33b471788f
2012-05-23 09:42:37 +02:00
|
|
|
osl::Condition passive_;
|
|
|
|
// to guarantee that passive_ is eventually set (to avoid deadlock, see
|
|
|
|
// dispose), activeCalls_ only counts those calls for which it can be
|
|
|
|
// guaranteed that incrementActiveCalls is indeed followed by
|
|
|
|
// decrementActiveCalls, without an intervening exception
|
|
|
|
osl::Condition terminated_;
|
2011-01-26 09:26:59 +01:00
|
|
|
|
|
|
|
osl::Mutex mutex_;
|
Better fix for ThreadPool/ORequestThread life cycle
This is a follow up to d015384e1d98fe77fd59339044f58efb1ab9fb25 "Fixed
ThreadPool (and dependent ORequestThread) life cycle" that still had some
problems:
* First, if Bridge::terminate was first entered from the reader or writer
thread, it would not join on that thread, so that thread could still be running
during exit.
That has been addressed by giving Bridge::dispose new semantics: It waits until
both Bridge::terminate has completed (even if that was called from a different
thread) and all spawned threads (reader, writer, ORequestThread workers) have
been joined. (This implies that Bridge::dispose must not be called from such a
thread, to avoid deadlock.)
* Second, if Bridge::terminate was first entered from an ORequestThread, the
call to uno_threadpool_dispose(0) to join on all such worker threads could
deadlock.
That has been addressed by making the last call to uno_threadpool_destroy wait
to join on all worker threads, and by calling uno_threadpool_destroy only from
the final Bridge::terminate (from Bridge::dispose), to avoid deadlock. (The
special semantics of uno_threadpool_dispose(0) are no longer needed and have
been removed, as they conflicted with the fix for the third problem below.)
* Third, once uno_threadpool_destroy had called uno_threadpool_dispose(0), the
ThreadAdmin singleton had been disposed, so no new remote bridges could
successfully be created afterwards.
That has been addressed by making ThreadAdmin a member of ThreadPool, and making
(only) those uno_ThreadPool handles with overlapping life spans share one
ThreadPool instance (which thus is no longer a singleton, either).
Additionally, ORequestThread has been made more robust (in the style of
salhelper::Thread) to avoid races.
Change-Id: I2cbd1b3f9aecc1bf4649e482d2c22b33b471788f
2012-05-23 09:42:37 +02:00
|
|
|
State state_;
|
2011-01-26 09:26:59 +01:00
|
|
|
Listeners listeners_;
|
2012-05-16 22:09:21 +02:00
|
|
|
uno_ThreadPool threadPool_;
|
2011-01-26 09:26:59 +01:00
|
|
|
rtl::Reference< Writer > writer_;
|
|
|
|
rtl::Reference< Reader > reader_;
|
|
|
|
bool currentContextMode_;
|
|
|
|
Stubs stubs_;
|
|
|
|
std::size_t proxies_;
|
|
|
|
std::size_t calls_;
|
|
|
|
bool normalCall_;
|
|
|
|
std::size_t activeCalls_;
|
|
|
|
|
|
|
|
// Only accessed from reader_ thread:
|
|
|
|
Mode mode_;
|
|
|
|
sal_Int32 random_;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2011-06-02 16:49:28 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|