From 404c4650a46a5be9f4eb4aebd6640e63004fe3ab Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 7 Feb 2006 07:22:51 +0000
Subject: [PATCH] Eliminate again yet another unnecessary call to
 RingBufFull().

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

diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 0613c93723..32871b9d9b 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -1516,12 +1516,12 @@ void output_thread(void* arg)
 
 			/* Wait for full buffer or drain timeout */
 			if(sbbs->outbuf.highwater_mark) {
-				if(avail<sbbs->outbuf.highwater_mark)
+				if(avail<sbbs->outbuf.highwater_mark) {
 					sem_trywait_block(&sbbs->outbuf.highwater_sem,startup->outbuf_drain_timeout);
-				else
+					/* We (potentially) blocked, so get fill level again */
+		    		avail=RingBufFull(&sbbs->outbuf);
+				} else
 					sem_trywait(&sbbs->outbuf.highwater_sem);	
-				/* We (potentially) blocked, so get fill level again */
-		    	avail=RingBufFull(&sbbs->outbuf);
 			}
 
 			/*
-- 
GitLab