瀏覽代碼

有网友想使用自己的自旋锁

tags/v2.9.7
tearshark 4 年之前
父節點
當前提交
7bea4a2255
共有 2 個檔案被更改,包括 7 行新增1 行删除
  1. 1
    1
      librf/src/def.h
  2. 6
    0
      librf/src/spinlock.h

+ 1
- 1
librf/src/def.h 查看文件

@@ -1,6 +1,6 @@
#pragma once
#define LIB_RESUMEF_VERSION 20400 // 2.4.0
#define LIB_RESUMEF_VERSION 20401 // 2.4.1
#if defined(RESUMEF_MODULE_EXPORT)
#define RESUMEF_NS export namespace resumef

+ 6
- 0
librf/src/spinlock.h 查看文件

@@ -4,6 +4,10 @@
RESUMEF_NS
{
#if defined(RESUMEF_USE_CUSTOM_SPINLOCK)
using spinlock = RESUMEF_USE_CUSTOM_SPINLOCK;
#else
struct spinlock
{
static const size_t MAX_ACTIVE_SPIN = 1000;
@@ -82,4 +86,6 @@ RESUMEF_NS
lck.store(FREE_VALUE, std::memory_order_release);
}
};
#endif
}

Loading…
取消
儲存