summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wsc.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/wsc.go b/wsc.go
index afdc489..d5a27f9 100644
--- a/wsc.go
+++ b/wsc.go
@@ -39,6 +39,11 @@ type errbytesT struct {
var usemCount int64
/*
+ * This is more appropriately typed as uint64, but it needs to be cast to int64
+ * later anyway due to time.Duration, so let's just use int64.
+ */
+
+/*
* The actual logic in handling the connection, after authentication has been
* completed.
*/
@@ -124,7 +129,7 @@ func handleConn(
}
time.Sleep(
time.Duration(
- usemCount>>
+ atomic.LoadInt64(&usemCount)>>
config.Perf.UsemDelayShiftBits,
) * time.Millisecond,
)