sharded-gotify/api/stream
Jannis Mattheis 79e1dc9c9a Prevent deadlock on stream.Close()
GR = goroutine
[GR#1] http server gets closed
[GR#2] client.NotifyClose() will be executed
[GR#2] client.once.Do will be executed (lock's client.once.m)
[GR#1] stream.Close will be executed (lock's stream.lock)
[GR#1] client.Close will be executed (waits for client.once.m)
[GR#2] stream.remove will be executed (waits for stream.lock)

GR#1 holds lock stream.lock and waits for client.once.m
GR#2 holds lock client.once.m and waits for stream.lock

We prevent the deadlock with releasing the client.once.m lock earlier.
2018-11-22 20:59:29 +01:00
..
client.go Prevent deadlock on stream.Close() 2018-11-22 20:59:29 +01:00
once.go Prevent deadlock on stream.Close() 2018-11-22 20:59:29 +01:00
stream.go Close web socket connection on delete user 2018-04-02 12:35:16 +02:00
stream_test.go Prevent possible race condition on SetPingHandler 2018-11-22 20:59:29 +01:00