Commit fd970d5e authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Adrien Béraud

Revert "manager: add shared asio::io_context"

This reverts commit 36dfd11f.

Reason for revert: temporary win32 incompatibility

Change-Id: Ib6718b2427cf4e0f3d2f456c4722830232b850cd
parent 36639d8c
......@@ -209,8 +209,6 @@ AS_IF([test "x$enable_shared" == "xyes"], [
])
AC_MSG_RESULT([$RING_SHARED])
CPPFLAGS="${CPPFLAGS} -DASIO_STANDALONE"
dnl
dnl Check for the contrib directory
dnl
......
......@@ -83,9 +83,6 @@ using random_device = dht::crypto::random_device;
#include <opendht/thread_pool.h>
#include <asio/io_context.hpp>
#include <asio/executor_work_guard.hpp>
#ifndef WIN32
#include <sys/time.h>
#include <sys/resource.h>
......@@ -334,9 +331,6 @@ struct Manager::ManagerPimpl
Manager& base_; // pimpl back-pointer
std::shared_ptr<asio::io_context> ioContext_;
std::thread ioContextRunner_;
/** Main scheduler */
ScheduledExecutor scheduler_;
......@@ -414,7 +408,6 @@ struct Manager::ManagerPimpl
Manager::ManagerPimpl::ManagerPimpl(Manager& base)
: base_(base)
, ioContext_(std::make_shared<asio::io_context>())
, toneCtrl_(base.preferences)
, currentCallMutex_()
, dtmfKey_()
......@@ -438,15 +431,6 @@ Manager::ManagerPimpl::ManagerPimpl(Manager& base)
rand_.seed(seed);
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
......@@ -852,13 +836,6 @@ Manager::finish() noexcept
dht::ThreadPool::computation().join();
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) {
JAMI_ERR("%s", err.what());
}
......@@ -1727,12 +1704,6 @@ Manager::scheduler()
return pimpl_->scheduler_;
}
std::shared_ptr<asio::io_context>
Manager::ioContext() const
{
return pimpl_->ioContext_;
}
void
Manager::addTask(std::function<bool()>&& task)
{
......
......@@ -44,10 +44,6 @@
#include <functional>
#include <algorithm>
namespace asio {
class io_context;
}
namespace jami {
namespace video {
......@@ -862,8 +858,6 @@ class Manager {
ScheduledExecutor& scheduler();
std::shared_ptr<asio::io_context> ioContext() const;
void addTask(std::function<bool()>&& task);
std::shared_ptr<Task> scheduleTask(std::function<void()>&& task, std::chrono::steady_clock::time_point when);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment