compat.concurrentqueue
#includemoodycamel::ConcurrentQueue — lock-free MPMC queue (header-only)
#include <c_api/concurrentqueue.h>
mcpp add compat.concurrentqueue@1.0.5
Usage
From this repository's own test project — built and run by CI, not written for the website.
// 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 · project tests/examples/concurrentqueue-c-api
Build
- targets
concurrentqueue (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*
Features
| feature | declares |
|---|---|
| c-api | sources, defines |
Sources (1)
mcpp_generated/concurrentqueue_anchor.c
Generated files
mcpp_generated/concurrentqueue_anchor.c
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
1.0.5 latest |
LinuxWindowsmacOS | source | 4d6368a27492… |