From 8ffe1d24e2922a024f61261aeee5a58648cc17b3 Mon Sep 17 00:00:00 2001 From: tearshark Date: Mon, 23 Mar 2020 17:25:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86mutex=5Fv2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- librf/src/mutex_v2.cpp | 8 ++++---- librf/src/mutex_v2.inl | 8 +------- vs_proj/librf.vcxproj | 4 ++-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/librf/src/mutex_v2.cpp b/librf/src/mutex_v2.cpp index 6377e06..6b5535f 100644 --- a/librf/src/mutex_v2.cpp +++ b/librf/src/mutex_v2.cpp @@ -78,10 +78,10 @@ RESUMEF_NS { this->_thandler = this->_scheduler->timer()->add_handler(tp, [st = counted_ptr{ this }](bool canceld) - { - if (!canceld) - st->on_timeout(); - }); + { + if (!canceld) + st->on_timeout(); + }); } diff --git a/librf/src/mutex_v2.inl b/librf/src/mutex_v2.inl index 75f6214..11f864d 100644 --- a/librf/src/mutex_v2.inl +++ b/librf/src/mutex_v2.inl @@ -20,20 +20,14 @@ RESUMEF_NS void add_timeout_timer(std::chrono::system_clock::time_point tp); - inline scheduler_t* get_scheduler() const noexcept - { - return _scheduler; - } - inline void on_await_suspend(coroutine_handle<> handler, scheduler_t* sch, state_base_t* root) noexcept { this->_scheduler = sch; this->_coro = handler; this->_root = root; } - - timer_handler _thandler; protected: + timer_handler _thandler; state_base_t* _root; std::atomic _value; }; diff --git a/vs_proj/librf.vcxproj b/vs_proj/librf.vcxproj index 7d7d787..69b1986 100644 --- a/vs_proj/librf.vcxproj +++ b/vs_proj/librf.vcxproj @@ -40,13 +40,13 @@ Application - v142 + ClangCL true Application false - v142 + ClangCL true NotSet