提交 0a2561ef 编写于 作者: Y youngwolf

Use unsigned instead of uint_fast64_t as the reference number of io_context.

上级 f41446ab
......@@ -3,7 +3,7 @@
asio_dir = -I../../asio/asio/include/
# asio.hpp and asio directory should be available in this place.
# If possible, -std=c++14 or -std=c++1y would be better.
# If possible, a higher edition of c++ would be always better.
cflag = -Wall -fexceptions -std=c++11
ifeq (${MAKECMDGOALS}, debug)
cflag += -g -DDEBUG
......
......@@ -59,7 +59,7 @@ protected:
struct context
{
asio::io_context io_context;
uint_fast64_t refs;
unsigned refs;
#ifdef ASCS_AVOID_AUTO_STOP_SERVICE
#if ASIO_VERSION > 101100
asio::executor_work_guard<typename asio::io_context::executor_type> work;
......@@ -124,9 +124,12 @@ public:
}
#endif
#endif
int get_io_context_num() const {return (int) context_can.size();}
virtual ~service_pump() {stop_service();}
int get_io_context_num() const {return (int) context_can.size();}
void get_io_context_refs(std::list<unsigned>& refs)
{if (!single_io_context) ascs::do_something_to_all(context_can, context_can_mutex, [&](context& item) {refs.push_back(item.refs);});}
operator asio::io_context& () {return assign_io_context();}
#if ASIO_VERSION > 101100
asio::io_context::executor_type get_executor() {return assign_io_context().get_executor();}
......@@ -137,7 +140,7 @@ public:
return context_can.front().io_context;
context* ctx = nullptr;
uint_fast64_t refs = 0;
unsigned refs = 0;
std::lock_guard<std::mutex> lock(context_can_mutex);
ascs::do_something_to_one(context_can, [&](context& item) {
......
......@@ -146,7 +146,7 @@ protected:
if (re < 0)
unified_out::error_out("ikcp_input return error: %d", re);
else
this->need_kcp_check = true;
need_kcp_check = true;
});
msg_can.clear();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册