https://gitlab.synchro.net/main/sbbs/-/commit/a1893b4750602cce44e8cb12
Added Files:
src/sbbs3/systotals.c
Modified Files:
src/sbbs3/getstats.c getstats.h objects.mk sbbs.jsdocs.vcxproj sbbs.vcxproj
Log Message:
Move the message/file total cache out of getstats.c
getstats.c is compiled into five single-threaded stand-alone utility link
sets, and 52d64f2934 (county-27-real, 2026-08-17) guarded its mutex with XPDEV_THREAD_SAFE on the assumption that the define marks the
multi-threaded link set. It does on MSVC, where it comes from
xpdev_mt.props. It does not under GNU make, where sbbs3/GNUmakefile folds XPDEV-MT_CFLAGS into the base CFLAGS, so every object gets it - which
left the mingw-w64 utils build failing to link sbbsecho.exe on the same
four pthread symbols. Linux never showed it, there or before, because
pthread is available to every link set.
No define means "the thread wrappers are linked" on both build systems,
so stop asking. The counting and its cache move to systotals.c, which
only the BBS links; getstats.c keeps the getposts()/getfiles() primitives
they build on and no longer references threading at all.
The invalidation flags stay in getstats.c, because the hooks that set them
are in files the utilities also compile (addfile()/removefile() in
filedat.c, and userdat.c calls the latter). Setting a flag is a plain
store, which needs no thread wrappers, and losing one to a race costs at
most totals_interval seconds of currency - the same guarantee that
already covers a base changed by another process. The cache tests and
clears the flag under its own mutex, so a base changed mid-enumeration
leaves it set and the next caller re-counts.
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net