summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLutz Bichler <Lutz.Bichler@bmw.de>2015-02-16 12:39:08 +0100
committerLutz Bichler <Lutz.Bichler@bmw.de>2015-02-16 12:39:08 +0100
commit6da6c32279be96ca97be438b6284beabfea1bbf4 (patch)
tree42b7da872d7779b658981e8ef8a2251b79879d84
parenta77e0428533e29c74425737355e5f38094e612eb (diff)
downloadvSomeIP-6da6c32279be96ca97be438b6284beabfea1bbf4.tar.gz
Do not open a separate thread in "application.start".
Renamed main service object (host_io_ to io_). Removed some log messages.
-rw-r--r--implementation/runtime/include/application_impl.hpp4
-rw-r--r--implementation/runtime/src/application_impl.cpp12
2 files changed, 6 insertions, 10 deletions
diff --git a/implementation/runtime/include/application_impl.hpp b/implementation/runtime/include/application_impl.hpp
index 70c408d..dc144d6 100644
--- a/implementation/runtime/include/application_impl.hpp
+++ b/implementation/runtime/include/application_impl.hpp
@@ -86,7 +86,7 @@ public:
routing_manager * get_routing_manager() const;
private:
- void service(boost::asio::io_service &_io);
+ void service();
inline void update_session() {
session_++;
if (0 == session_) {
@@ -101,7 +101,7 @@ private:
std::string name_;
std::shared_ptr<configuration> configuration_;
- boost::asio::io_service host_io_;
+ boost::asio::io_service io_;
// Proxy to or the Routing Manager itself
std::shared_ptr<routing_manager> routing_;
diff --git a/implementation/runtime/src/application_impl.cpp b/implementation/runtime/src/application_impl.cpp
index 32c2d0c..b43acb8 100644
--- a/implementation/runtime/src/application_impl.cpp
+++ b/implementation/runtime/src/application_impl.cpp
@@ -21,7 +21,7 @@
namespace vsomeip {
application_impl::application_impl(const std::string &_name) :
- name_(_name), routing_(0), signals_(host_io_, SIGINT, SIGTERM) {
+ name_(_name), routing_(0), signals_(io_, SIGINT, SIGTERM) {
}
application_impl::~application_impl() {
@@ -103,17 +103,14 @@ void application_impl::start() {
if (routing_)
routing_->start();
- // start the threads that process the io service queues
- std::thread its_host_thread(
- std::bind(&application_impl::service, this, std::ref(host_io_)));
- its_host_thread.join();
+ io_.run();
}
void application_impl::stop() {
if (routing_)
routing_->stop();
- host_io_.stop();
+ io_.stop();
}
void application_impl::offer_service(service_t _service, instance_t _instance,
@@ -240,7 +237,7 @@ std::shared_ptr<configuration> application_impl::get_configuration() const {
}
boost::asio::io_service & application_impl::get_io() {
- return host_io_;
+ return io_;
}
void application_impl::on_event(event_type_e _event) {
@@ -300,7 +297,6 @@ routing_manager * application_impl::get_routing_manager() const {
// Internal
void application_impl::service(boost::asio::io_service &_io) {
_io.run();
- VSOMEIP_INFO << "Application stopped running...";
}
} // namespace vsomeip