• src/syncterm/conn_buf.c conn_buffer_test.c conn_buffer_test.vcxprojsrc

    From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Jul 24 12:18:50 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/48d6f31e1125d1a83ea9c6a8
    Added Files:
    src/syncterm/conn_buf.c conn_buffer_test.c conn_buffer_test.vcxproj Modified Files:
    src/syncterm/CMakeLists.txt GNUmakefile SyncTERM.sln SyncTERM.vcxproj conn.c conn.h conn_conpty.c conn_mqtt.c conn_pty.c modem.c objects.mk rlogin.c ssh.c telnets.c term.c wren_bind_conn.c
    Log Message:
    Decouple connection buffer readers and writers

    Connection rings used one mutex for both producers and consumers, so
    network I/O contended with terminal and protocol processing even though
    the read and write sections do not overlap.

    Track monotonic head and tail positions with acquire/release atomics.
    Serialize same-side callers with independent read and write mutexes,
    and use events to wake blocked operations without requiring the
    opposite side to take the same lock. Treat event state as a hint and
    recheck the atomic buffer predicate after every wake.

    Take both locks when resetting a ring so reset remains synchronous even
    if a caller misbehaves. Update every connection provider and direct
    Wren buffer access for the appropriate side lock.

    Add regression coverage for wraparound, peeking, data and space waits,
    lock independence, synchronous reset, stale event state, and
    multi-waiter handoff. Wire the test into the GNU, CMake, and Visual
    Studio builds.

    Co-authored-by: OpenAI Codex <noreply@openai.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)