forked from topfreegames/pitaya
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port topfreegames#182 to v2 (topfreegames#207)
* conn/message: add mutex to routes/codes maps When running in high concurrency scenarios the routes/codes maps may be updated by concurrent goroutines at the same time, resulting in a race condition while calling `SetDictionary`. This patch adds a mutex to control access to these maps. Signed-off-by: Rodrigo Chacon <[email protected]> * conn/message: protect routes map exposure on GetDictionary Since Go maps work as pointers to the internal data structures, when calling GetDictionary we're actually exposing the internal routes map for its callers. This commit copies the routes map into a new map instance to prevent its exposure. Signed-off-by: Rodrigo Chacon <[email protected]> Co-authored-by: Rodrigo Chacon <[email protected]>
- Loading branch information
1 parent
5b797cb
commit dbe567b
Showing
3 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters