summaryrefslogtreecommitdiff
path: root/ws.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ws.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/ws.go b/ws.go
index ec626a3..0bccee4 100644
--- a/ws.go
+++ b/ws.go
@@ -264,7 +264,7 @@ var (
/*
* Note that the key for cancelPool is a userID rather than a sessionID
*/
- cancelPool map[string](*context.CancelFunc)
+ cancelPool = make(map[string](*context.CancelFunc))
/*
* Normal Go maps are not thread safe, so we protect large cancelPool
* operations such as addition and deletion under a RWMutex.
@@ -272,21 +272,6 @@ var (
cancelPoolLock sync.RWMutex
)
-func setupCancelPool() error {
- /*
- * It would be unusual for this function to run concurrently with
- * anything else that modifies cancelPool, so we fail when the lock is
- * unsuccessful.
- */
- r := cancelPoolLock.TryLock()
- if !r {
- return fmt.Errorf("cannot set up cancelPool: %w", errUnexpectedRace)
- }
- defer cancelPoolLock.Unlock()
- cancelPool = make(map[string](*context.CancelFunc))
- return nil
-}
-
/*
* Only call this when it is okay for propagation to fail, such as in course
* number updates. Failures are currently ignored.