summaryrefslogtreecommitdiff
path: root/ws.go
diff options
context:
space:
mode:
Diffstat (limited to 'ws.go')
-rw-r--r--ws.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/ws.go b/ws.go
index 9a0139d..ec626a3 100644
--- a/ws.go
+++ b/ws.go
@@ -252,7 +252,7 @@ type errbytesT struct {
}
var (
- chanPool map[string](*chan string)
+ chanPool = make(map[string](*chan string))
/*
* Normal Go maps are not thread safe, so we protect large chanPool
* operations such as addition and deletion under a RWMutex.
@@ -260,21 +260,6 @@ var (
chanPoolLock sync.RWMutex
)
-func setupChanPool() error {
- /*
- * It would be unusual for this function to run concurrently with
- * anything else that modifies chanPool, so we fail when the lock is
- * unsuccessful.
- */
- r := chanPoolLock.TryLock()
- if !r {
- return fmt.Errorf("cannot set up chanPool: %w", errUnexpectedRace)
- }
- defer chanPoolLock.Unlock()
- chanPool = make(map[string](*chan string))
- return nil
-}
-
var (
/*
* Note that the key for cancelPool is a userID rather than a sessionID