Commit 59bf1d78 authored by Pavel Vainerman's avatar Pavel Vainerman

(evloop): исправление ошибки с неверным типов callback-функции

parent 9ad90bb4
...@@ -82,8 +82,8 @@ namespace uniset ...@@ -82,8 +82,8 @@ namespace uniset
private: private:
void onStop() noexcept; void onStop( ev::async& w, int revents ) noexcept;
void onPrepare() noexcept; void onPrepare( ev::async& w, int revents ) noexcept;
void defaultLoop() noexcept; void defaultLoop() noexcept;
std::atomic_bool cancelled = { false }; std::atomic_bool cancelled = { false };
......
...@@ -52,7 +52,7 @@ namespace uniset ...@@ -52,7 +52,7 @@ namespace uniset
} }
{ {
std::lock_guard<std::mutex> lck(thr_mutex); std::lock_guard<std::mutex> lock(thr_mutex);
if( !thr ) if( !thr )
{ {
...@@ -128,7 +128,7 @@ namespace uniset ...@@ -128,7 +128,7 @@ namespace uniset
if( !w ) if( !w )
return false; return false;
std::lock_guard<std::mutex> l(wlist_mutex); std::lock_guard<std::mutex> lock(wlist_mutex);
try try
{ {
...@@ -168,8 +168,14 @@ namespace uniset ...@@ -168,8 +168,14 @@ namespace uniset
return wlist.size(); return wlist.size();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void CommonEventLoop::onPrepare() noexcept void CommonEventLoop::onPrepare( ev::async& w, int revents ) noexcept
{ {
if( EV_ERROR & revents )
{
// cerr << myname << "(CommonEventLoop::onPrepare): invalid event" << endl;
return;
}
prep_notify = false; prep_notify = false;
{ {
std::lock_guard<std::mutex> lock(prep_mutex); std::lock_guard<std::mutex> lock(prep_mutex);
...@@ -194,8 +200,14 @@ namespace uniset ...@@ -194,8 +200,14 @@ namespace uniset
prep_event.notify_all(); prep_event.notify_all();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void CommonEventLoop::onStop() noexcept void CommonEventLoop::onStop( ev::async& aw, int revents ) noexcept
{ {
if( EV_ERROR & revents )
{
// cerr << myname << "(CommonEventLoop::onStop): invalid event" << endl;
return;
}
// здесь список не защищаем wlist_mutex // здесь список не защищаем wlist_mutex
// потому-что onStop будет вызываться // потому-что onStop будет вызываться
// из evstop, где он уже будет под "блокировкой" // из evstop, где он уже будет под "блокировкой"
......
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