Skip to content

Conversation

dsnet
Copy link
Member

@dsnet dsnet commented Jul 27, 2019

The reflect.Value.Interface method shallow copies the underlying value,
which may copy mutexes and atomically-accessed fields.
Some usages of the Interface method is only to check if the interface value
implements an interface. In which case the shallow copy was unnecessary.
Change those usages to use the reflect.Value.Implements method instead.

Fixes #838

@dsnet dsnet requested a review from neild July 27, 2019 01:53
The reflect.Value.Interface method shallow copies the underlying value,
which may copy mutexes and atomically-accessed fields.
Some usages of the Interface method is only to check if the interface value
implements an interface. In which case the shallow copy was unnecessary.
Change those usages to use the reflect.Value.Implements method instead.

Fixes #838
@dsnet
Copy link
Member Author

dsnet commented Aug 5, 2019

\cc @neild

@dsnet dsnet merged commit 4c88cc3 into master Aug 5, 2019
@dsnet dsnet deleted the fix-race branch August 5, 2019 18:00
@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jsonpb: race marshaling logic

2 participants