compat.concurrentqueue
#includemoodycamel::ConcurrentQueue — lock-free MPMC queue (header-only)
#include <c_api/concurrentqueue.h>
mcpp add compat.concurrentqueue@1.0.5
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// compat.concurrentqueue `c-api` feature — drive the flat extern "C" surface
// over both queues. Values cross the boundary as void*, so the test round-trips
// integers through MoodycamelValue and checks them on the way out. A package
// that compiled the wrappers against the wrong queue type (cq vs bcq handles
// are both void*) would still link and swap semantics — which is exactly the
// failure these assertions catch.
#include <c_api/concurrentqueue.h>
#include <cstdio>
#include <stdint.h>
int main() {
bool ok = true;
auto check = [&](bool cond, const char* what) {
if (!cond) {
std::printf("FAIL: %s\n", what);
ok = false;
}
};
// ---- plain queue -------------------------------------------------------
{
// …
tests/examples/concurrentqueue-c-api/tests/c_api.cpp · 專案 tests/examples/concurrentqueue-c-api
建置
- targets
concurrentqueue (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*
功能
| 功能 | 宣告了 |
|---|---|
| c-api | sources, defines |
原始檔 (1)
mcpp_generated/concurrentqueue_anchor.c
產生的檔案
mcpp_generated/concurrentqueue_anchor.c
版本
| 版本 | 平台 | 鏡像 | sha256 |
|---|---|---|---|
1.0.5 最新 |
LinuxWindowsmacOS | 來源 | 4d6368a27492… |