Browse Source

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

tags/v2.9.7
tearshark 4 years ago
parent
commit
7bea4a2255
2 changed files with 7 additions and 1 deletions
  1. 1
    1
      librf/src/def.h
  2. 6
    0
      librf/src/spinlock.h

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

@@ -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 View File

@@ -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…
Cancel
Save