feat(concurrentqueue): add compat.concurrentqueue 1.0.5 - #278
Merged
Conversation
moodycamel::ConcurrentQueue — the lock-free MPMC queue, plus its blocking
sibling and a flat C API over both. Shape B (header-only): the three public
headers sit at the tarball root, so `include_dirs = {"*"}` plus an anchor TU
is the package; consumers write `#include <concurrentqueue.h>` exactly as
upstream's README shows.
The one compilable optional component — `c_api/`'s two extern "C" wrapper
TUs — sits behind a default-off `c-api` feature (the compat.cjson `utils`
precedent). Windows needs `MOODYCAMEL_STATIC` on BOTH sides: the header
defaults to `__declspec(dllimport)`, which is wrong for the package's own
TUs (they define the functions, and `cflags` never reaches a .cpp — hence
`cxxflags`) and for a static-archive consumer (hence the feature's
interface `defines`). The macro is only read under `#ifdef _WIN32`, so
defining it everywhere is inert on linux/macos. Verified in the emitted
compile_commands.json that all four TUs carry it.
Tests: tests/examples/concurrentqueue asserts FIFO order, bulk round-trips,
move-only elements, a blocking consumer that REALLY waits (empty-queue
wait_dequeue_timed must burn its 50ms timeout), and a 4x4 MPMC race checked
for exact-once delivery. tests/examples/concurrentqueue-c-api consumes the
feature and round-trips integers through the void* C API. Both members
register in the workspace manifest.
Verified locally with mcpp 2026.8.27.1 (CI pins 2026.8.27.2; the release
CDN times out from this host): both members green from cold; the gate is
real — a TU referencing moodycamel_cq_create against the default build
fails to LINK (undefined reference), and the default build's object dir
holds the anchor alone. No CN mirror: no GITCODE_TOKEN on this host, so the
descriptor uses the plain-string upstream url fallback and the descriptor
catalog entry lands in docs/descriptor-examples.md (+ zh), per the post-mcpplibs#277
README layout.
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
内容
收录
moodycamel::ConcurrentQueue1.0.5(cameron314/concurrentqueue)为 compat.concurrentqueue。concurrentqueue.h/blockingconcurrentqueue.h/lightweightsemaphore.h)都在 tarball 根,include_dirs = {"*"}+ anchor TU 即整包;消费者按上游 README 的写法#include <concurrentqueue.h>。c-api(默认关闭) —— 包里唯一可编译的可选组件:c_api/的两个extern "C"封装 TU(compat.cjsonutils先例)。tests/、benchmarks/自带main(),lib 目标不能收(对象会急切进入消费者链接)。MOODYCAMEL_STATIC双侧声明 —— C API 头未被告知时按__declspec(dllimport)声明,对包自身 TU(要定义函数;cflags到不了.cpp,故用cxxflags)与静态库消费者(feature 的接口defines)都不成立。宏只在#ifdef _WIN32内被读,linux/macos 上无效。{"BSD-2-Clause", "BSL-1.0"}。GITCODE_TOKEN,按回退方案用纯字符串 upstream url,mcpp-res/concurrentqueue留待维护者补充;mirror-cn-reachable对纯字符串 url 无新校验项。4d6368a27492d86011fde5ca0cf386dce7c49cd425aa3d9b063ca6ec373a6ef3(连算两次一致)。测试成员
tests/examples/concurrentqueue:单线程 FIFO、bulk 往返、ProducerToken、move-only 元素、阻塞消费者(空队列wait_dequeue_timed必须真的等满 50ms)、4×4 MPMC 竞争下逐值「恰好一次」。tests/examples/concurrentqueue-c-api:长式声明features = ["c-api"],整数经void*往返校验和比对(cq 与 bcq 句柄都是void*,装错队列会在这里暴露)。验证
mcpp test -p concurrentqueue→ test result ok(冷启动)mcpp test -p concurrentqueue-c-api→ test result ok(独立重编,feature 生效)moodycamel_cq_create的 TU 链接默认构建对象报undefined reference;默认构建的包对象目录里只有 anchor,无任何c_api/*.o。mcpp xpkg parse);compile_commands.json确认-DMOODYCAMEL_STATIC到达全部四个 TU。设计文档:
.agents/docs/2026-08-29-add-concurrentqueue-plan.md。目录条目落在docs/descriptor-examples.md(+ zh)的「header-only (with features)」行 —— README 在 #277 后不再承载逐包目录。🤖 Generated with Claude Code