Skip to content
Snippets Groups Projects
Commit fd970d5e authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Adrien Béraud
Browse files

Revert "manager: add shared asio::io_context"

This reverts commit 36dfd11f.

Reason for revert: temporary win32 incompatibility

Change-Id: Ib6718b2427cf4e0f3d2f456c4722830232b850cd
parent 36639d8c
Branches
Tags
No related merge requests found
...@@ -209,8 +209,6 @@ AS_IF([test "x$enable_shared" == "xyes"], [ ...@@ -209,8 +209,6 @@ AS_IF([test "x$enable_shared" == "xyes"], [
]) ])
AC_MSG_RESULT([$RING_SHARED]) AC_MSG_RESULT([$RING_SHARED])
CPPFLAGS="${CPPFLAGS} -DASIO_STANDALONE"
dnl dnl
dnl Check for the contrib directory dnl Check for the contrib directory
dnl dnl
......
...@@ -83,9 +83,6 @@ using random_device = dht::crypto::random_device; ...@@ -83,9 +83,6 @@ using random_device = dht::crypto::random_device;
#include <opendht/thread_pool.h> #include <opendht/thread_pool.h>
#include <asio/io_context.hpp>
#include <asio/executor_work_guard.hpp>
#ifndef WIN32 #ifndef WIN32
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
...@@ -334,9 +331,6 @@ struct Manager::ManagerPimpl ...@@ -334,9 +331,6 @@ struct Manager::ManagerPimpl
Manager& base_; // pimpl back-pointer Manager& base_; // pimpl back-pointer
std::shared_ptr<asio::io_context> ioContext_;
std::thread ioContextRunner_;
/** Main scheduler */ /** Main scheduler */
ScheduledExecutor scheduler_; ScheduledExecutor scheduler_;
...@@ -414,7 +408,6 @@ struct Manager::ManagerPimpl ...@@ -414,7 +408,6 @@ struct Manager::ManagerPimpl
Manager::ManagerPimpl::ManagerPimpl(Manager& base) Manager::ManagerPimpl::ManagerPimpl(Manager& base)
: base_(base) : base_(base)
, ioContext_(std::make_shared<asio::io_context>())
, toneCtrl_(base.preferences) , toneCtrl_(base.preferences)
, currentCallMutex_() , currentCallMutex_()
, dtmfKey_() , dtmfKey_()
...@@ -438,15 +431,6 @@ Manager::ManagerPimpl::ManagerPimpl(Manager& base) ...@@ -438,15 +431,6 @@ Manager::ManagerPimpl::ManagerPimpl(Manager& base)
rand_.seed(seed); rand_.seed(seed);
jami::libav_utils::ring_avcodec_init(); jami::libav_utils::ring_avcodec_init();
ioContextRunner_ = std::thread([context = ioContext_](){
try {
auto work = asio::make_work_guard(*context);
context->run();
} catch (const std::exception& ex) {
JAMI_ERR("Unexpected io_context thread exception: %s", ex.what());
}
});
} }
bool bool
...@@ -852,13 +836,6 @@ Manager::finish() noexcept ...@@ -852,13 +836,6 @@ Manager::finish() noexcept
dht::ThreadPool::computation().join(); dht::ThreadPool::computation().join();
pj_shutdown(); pj_shutdown();
if (!pimpl_->ioContext_->stopped()){
pimpl_->ioContext_->reset(); // allow to finish
pimpl_->ioContext_->stop(); // make thread stop
}
if (pimpl_->ioContextRunner_.joinable())
pimpl_->ioContextRunner_.join();
} catch (const VoipLinkException &err) { } catch (const VoipLinkException &err) {
JAMI_ERR("%s", err.what()); JAMI_ERR("%s", err.what());
} }
...@@ -1727,12 +1704,6 @@ Manager::scheduler() ...@@ -1727,12 +1704,6 @@ Manager::scheduler()
return pimpl_->scheduler_; return pimpl_->scheduler_;
} }
std::shared_ptr<asio::io_context>
Manager::ioContext() const
{
return pimpl_->ioContext_;
}
void void
Manager::addTask(std::function<bool()>&& task) Manager::addTask(std::function<bool()>&& task)
{ {
......
...@@ -44,10 +44,6 @@ ...@@ -44,10 +44,6 @@
#include <functional> #include <functional>
#include <algorithm> #include <algorithm>
namespace asio {
class io_context;
}
namespace jami { namespace jami {
namespace video { namespace video {
...@@ -862,8 +858,6 @@ class Manager { ...@@ -862,8 +858,6 @@ class Manager {
ScheduledExecutor& scheduler(); ScheduledExecutor& scheduler();
std::shared_ptr<asio::io_context> ioContext() const;
void addTask(std::function<bool()>&& task); void addTask(std::function<bool()>&& task);
std::shared_ptr<Task> scheduleTask(std::function<void()>&& task, std::chrono::steady_clock::time_point when); std::shared_ptr<Task> scheduleTask(std::function<void()>&& task, std::chrono::steady_clock::time_point when);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment