• src/sbbs3/CMakeLists.txt src/sbbs3/ctrl/sbbsctrl.bpr src/sbbs3/main.cp

    From Deucе@1:103/705 to Git commit to main/sbbs/master on Thu Dec 29 09:26:35 2022
    Modified Files:
    src/sbbs3/CMakeLists.txt src/sbbs3/ctrl/sbbsctrl.bpr src/sbbs3/main.cpp makevdd.bat ringbuf.c ringbuf.h sbbs.jsdocs.vcxproj sbbs.vcxproj sbbsdefs.mk sbbsexec.vcxproj sexyz.c sexyz.vcxproj websrvr.c websrvr.vcxproj
    Log Message:
    Remove RINGBUF_SEM for RINGBUG_EVENTWe've never really cared how many times the ring buffer has becomeempty, how many times data was added to it, or how many times we'vebeen over the highwater mark. These have effectively always beenevent signalling, with extra hackiness to clear "extra" semaphoreposts.This commit removes RINGBUF_SEM entirely, and uses events foreverything. There's an empty event (set when the ring buffer is empty),a data event (set when the ring buffer is not empty), and a highwaterevent (set when the ring buffer has at least highwater mark bytes).A RingBufWrite() will set data and highwater events if applicable,and clear the empty event.A RingBufRead() will set empty event and clear data and highwaterevents if applicable.RingBufReInit() will now set the empty event, and clear the dataand highwater events.These are the only actions the RingBuf API will perform on theevents, it does *not* clear the highwater event on a RingBufWrite()if the buffer does not have enough bytes in it for example, thiswill *only* be done by RingBufRead() or RingBufReInit(). Thisallows consumers to force specific behaviours (such as forcingthe highwater event on shutdown to prevent waiting for it). Sincethe current code was able to deal with the semaphores havingarbitrarily high counts, the existing code shouldn't have anyissue with this.For things that want to shut something down, we're now setting boththe data and highwater events to ensure it doesn't wait for atimeout (even for things that don't use highwater like the inbuf).The RingBuffer API should grow a thing to do this (RingBufferFlushperhaps?) rather than the consumers poking into the innardsarbitrarily.Tested on the webserver and RLogin server and seems to be workinggreat. sexyz builds. It seems there's some Windows thing thatuses the ringbuffer sem for something, but I couldn't figure outwhat... updated the build file, but no clue if that's broken or notnow... I'm sure DigitalMan will be happy to fix it if CI doesn'tcatch it. ;)This should allow the console object to grow a "flush" method thatwill set the highwater and data events.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)