Browse Source

增加一些注释

tags/v2.9.7
tearshark 4 years ago
parent
commit
563abf8aa3

+ 3
- 0
librf/src/event.h View File

@@ -41,6 +41,9 @@ namespace resumef
};
}
//提供一种在协程和非协程之间同步的手段。
//典型用法是在非协程的线程,或者异步代码里,调用signal()方法触发信号,
//协程代码里,调用co_await wait()等系列方法等待同步。
struct event_t
{
typedef std::shared_ptr<detail::event_impl> event_impl_ptr;

+ 1
- 0
tutorial/test_async_event.cpp View File

@@ -9,6 +9,7 @@
using namespace resumef;
//非协程的逻辑线程,或异步代码,可以通过event_t通知到协程,并且不会阻塞协程所在的线程。
std::thread async_set_event(const event_t & e, std::chrono::milliseconds dt)
{
return std::thread([=]

+ 1
- 1
tutorial/test_async_resumable.cpp View File

@@ -21,7 +21,7 @@ void dump(size_t idx, std::string name, T start, T end)
std::cout << idx << ":" << name << " ";
std::cout << N << " " << ns << " ns ";
std::cout << (ns / N) << " ns/op" << " ";
std::cout << (N * 100 * 1000 / ns) << "w/cps" << std::endl;
std::cout << (N * 100ll * 1000ll / ns) << "w/cps" << std::endl;
lock_console.unlock();
}

+ 1
- 1
vs_proj/librf.cpp View File

@@ -23,7 +23,7 @@ extern void resumable_main_benchmark_mem();
extern void resumable_main_benchmark_asio_server();
extern void resumable_main_benchmark_asio_client(intptr_t nNum);
int main(int argc, const char * argv[])
int main(int argc, const char* argv[])
{
resumable_main_modern_cb();
//resumable_main_benchmark_mem();

+ 10
- 6
vs_proj/librf.vcxproj View File

@@ -23,32 +23,32 @@
<ProjectGuid>{C1D4A6BD-592F-4E48-8178-7C87219BF80E}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>librf</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
@@ -208,7 +208,11 @@
<ClCompile Include="..\tutorial\test_async_timer.cpp" />
<ClCompile Include="..\tutorial\test_async_when_all.cpp" />
<ClCompile Include="..\tutorial\test_async_yield_return.cpp" />
<ClCompile Include="librf.cpp" />
<ClCompile Include="librf.cpp">
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Default</BasicRuntimeChecks>
<BufferSecurityCheck Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</BufferSecurityCheck>
<SDLCheck Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</SDLCheck>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\librf\librf.h" />

Loading…
Cancel
Save