Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: fix reflect.Value.Interface races #913

Merged
merged 1 commit into from Aug 5, 2019
Merged

all: fix reflect.Value.Interface races #913

merged 1 commit into from Aug 5, 2019

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