Browse Source

确保批量解锁的顺序

tags/v2.9.7
tearshark 4 years ago
parent
commit
fab455a02d
4 changed files with 6 additions and 5 deletions
  1. 1
    1
      librf/src/def.h
  2. 1
    2
      librf/src/mutex_v2.inl
  3. 2
    0
      librf/src/state.h
  4. 2
    2
      vs_proj/librf.vcxproj

+ 1
- 1
librf/src/def.h View File

@@ -1,6 +1,6 @@
#pragma once
#define LIB_RESUMEF_VERSION 20901 // 2.9.1
#define LIB_RESUMEF_VERSION 20902 // 2.9.2
#if defined(RESUMEF_MODULE_EXPORT)
#define RESUMEF_NS export namespace resumef

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

@@ -560,8 +560,7 @@ RESUMEF_NS
{
assert(unique_address != nullptr);

int _Ignored[] = { (mtxs.unlock(unique_address), 0)... };
(void)_Ignored;
(..., mtxs.unlock(unique_address));
}
}
}

+ 2
- 0
librf/src/state.h View File

@@ -137,6 +137,7 @@ RESUMEF_NS
inline bool is_ready() const noexcept
{
#pragma warning(disable : 6326) //warning C6326: Potential comparison of a constant with another constant.
//msvc认为是constexpr表达式(不写还给警告),然而,clang不这么认为。
//放弃constexpr,反正合格的编译器都会优化掉这个if判断的。
if
@@ -147,6 +148,7 @@ RESUMEF_NS
return 0 != reinterpret_cast<const std::atomic<uint16_t> &>(_has_value).load(std::memory_order_acquire);
else
return _has_value.load(std::memory_order_acquire) != result_type::None || _is_future;
#pragma warning(default : 6326)
}
inline bool has_handler_skip_lock() const noexcept
{

+ 2
- 2
vs_proj/librf.vcxproj View File

@@ -23,7 +23,7 @@
<ProjectGuid>{C1D4A6BD-592F-4E48-8178-7C87219BF80E}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>librf</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -46,7 +46,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>ClangCL</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>

Loading…
Cancel
Save