1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-12-11 07:54:58 +00:00
arikawa/internal
diamondburned 6c332ac145 {Voice,}Gateway: Fixed various race conditions
This commit fixes race conditions in both package voice, package
voicegateway and package gateway.

Originally, several race conditions exist when both the user's and the
pacemaker's goroutines both want to do several things to the websocket
connection. For example, the user's goroutine could be writing, and the
pacemaker's goroutine could trigger a reconnection. This is racey.

This issue is partially fixed by removing the pacer loop from package
heart and combining the ticker into the event (pacemaker) loop itself.

Technically, a race condition could still be triggered with care, but
the API itself never guaranteed any of those. As events are handled
using an internal loop into a channel, a race condition will not be
triggered just by handling events and writing to the websocket.
2020-10-22 10:47:27 -07:00
..
heart {Voice,}Gateway: Fixed various race conditions 2020-10-22 10:47:27 -07:00
moreatomic httputil: Fixed unlock of unlocked mutex bug 2020-08-04 14:09:43 -07:00
mulipartutil Multipartutil: move back to package api 2020-07-29 16:58:33 -07:00
zlib *: Separate utils and internal (#129) 2020-07-29 16:58:33 -07:00