mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-17 01:12:51 +00:00
internal/impl: fix race ExtensionInfo.lazyInitSlow
The xi.init flag should not be set until after we have truly initialized everything. Change-Id: I43dcb300917145ce19a7199fa871acd0df325c6c Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/194439 Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
parent
e87cf53d57
commit
2df47c918b
@ -145,7 +145,7 @@ func (xi *ExtensionInfo) lazyInitSlow() {
|
||||
if xi.init == extensionInfoFullInit {
|
||||
return
|
||||
}
|
||||
atomic.StoreUint32(&xi.init, extensionInfoFullInit)
|
||||
defer atomic.StoreUint32(&xi.init, extensionInfoFullInit)
|
||||
|
||||
if xi.desc == nil {
|
||||
xi.initFromLegacy()
|
||||
|
Loading…
Reference in New Issue
Block a user