fix: vendored sqlite builds SQLITE_THREADSAFE=1 — std.thread exists now

THREADSAFE=0 was correct when sx had no threads; with std.thread (S6)
and std.http's pooled dispatch (S7b), concurrent connections corrupted
sqlite's unprotected globals (caught live: distd under ab -c20 died
with free-of-unallocated inside yy_reduce). Serialized mode is
sqlite's own default and safe for every consumer; per-connection use
across threads is the supported pattern.
This commit is contained in:
agra
2026-06-12 22:38:43 +03:00
parent e57a27205e
commit 39488133c9

View File

@@ -27,8 +27,8 @@
// meaningful with user-defined functions (callbacks, above);
// * varargs APIs (sqlite3_config, db_config, log, mprintf) —
// configuration happens via the unit's compile-time defines;
// * UTF-16 variants (we are UTF-8 only), the mutex/VFS layer
// (built SQLITE_THREADSAFE=0), sessions/snapshots/vtabs/loadable
// * UTF-16 variants (we are UTF-8 only), the VFS layer,
// sessions/snapshots/vtabs/loadable
// extensions (not compiled in), deprecated API (compiled out via
// SQLITE_OMIT_DEPRECATED).
//
@@ -53,7 +53,7 @@
sqlib :: #import c {
#define "SQLITE_DQS=0";
#define "SQLITE_THREADSAFE=0";
#define "SQLITE_THREADSAFE=1";
#define "SQLITE_DEFAULT_MEMSTATUS=0";
#define "SQLITE_OMIT_DEPRECATED";
#define "SQLITE_OMIT_SHARED_CACHE";