From 5173dc9ffe93a84fcd258ba04a34617ef420fa40 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 7 Feb 2006 07:14:19 +0000
Subject: [PATCH] I think this is more what Deuce intended.

---
 src/sbbs3/main.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index ac0bcfb2b4..8c2c4091e8 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -1504,7 +1504,7 @@ void output_thread(void* arg)
 		 */
 		if(bufbot == buftop) {
 			/* Wait for something to output in the RingBuffer */
-			if(!RingBufFull(&sbbs->outbuf)) {
+			if(RingBufFull(&sbbs->outbuf)==0) {	/* empty */
 				if(sem_trywait_block(&sbbs->outbuf.sem,1000))
 					continue;
 			}
@@ -1512,16 +1512,16 @@ void output_thread(void* arg)
 				sem_trywait(&sbbs->outbuf.sem);
 
 			/* Check for spurious sem post... */
-			if(!RingBufFull(&sbbs->outbuf))
+			if(RingBufFull(&sbbs->outbuf)==0)
 				continue;
 
 			/* Wait for full buffer or drain timeout */
-			if(RingBufFull(&sbbs->outbuf)<sbbs->outbuf.highwater_mark) {
-				if(sbbs->outbuf.highwater_mark)
+			if(sbbs->outbuf.highwater_mark) {
+				if(RingBufFull(&sbbs->outbuf)<sbbs->outbuf.highwater_mark)
 					sem_trywait_block(&sbbs->outbuf.highwater_sem,startup->outbuf_drain_timeout);
+				else
+					sem_trywait(&sbbs->outbuf.highwater_sem);	
 			}
-			else
-				sem_trywait(&sbbs->outbuf.highwater_sem);
 
 			/*
 			 * At this point, there's something to send and,
-- 
GitLab