Browse Source

整理mutex_v2代码

tags/v2.9.7
tearshark 4 years ago
parent
commit
8ffe1d24e2
3 changed files with 7 additions and 13 deletions
  1. 4
    4
      librf/src/mutex_v2.cpp
  2. 1
    7
      librf/src/mutex_v2.inl
  3. 2
    2
      vs_proj/librf.vcxproj

+ 4
- 4
librf/src/mutex_v2.cpp View File

@@ -78,10 +78,10 @@ RESUMEF_NS
{
this->_thandler = this->_scheduler->timer()->add_handler(tp,
[st = counted_ptr<state_mutex_t>{ this }](bool canceld)
{
if (!canceld)
st->on_timeout();
});
{
if (!canceld)
st->on_timeout();
});
}



+ 1
- 7
librf/src/mutex_v2.inl View File

@@ -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<mutex_v2_impl**> _value;
};

+ 2
- 2
vs_proj/librf.vcxproj View File

@@ -40,13 +40,13 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>ClangCL</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>ClangCL</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>

Loading…
Cancel
Save