mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 22:22:46 +00:00
Fix data races reported by go test -race ./... (#748)
This commit is contained in:
parent
45d24d3fb5
commit
e66933b108
2 changed files with 16 additions and 6 deletions
|
@ -185,6 +185,7 @@ func (n *Notifier) wakeupUsers(userIDs []string, newPos types.SyncPosition) {
|
|||
// fetchUserStream retrieves a stream unique to the given user. If makeIfNotExists is true,
|
||||
// a stream will be made for this user if one doesn't exist and it will be returned. This
|
||||
// function does not wait for data to be available on the stream.
|
||||
// NB: Callers should have locked the mutex before calling this function.
|
||||
func (n *Notifier) fetchUserStream(userID string, makeIfNotExists bool) *UserStream {
|
||||
stream, ok := n.userStreams[userID]
|
||||
if !ok && makeIfNotExists {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue