mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-03-12 13:13:23 +00:00
Previously, when aberrantLoadMessageDesc returned it was guaranteed to have initialized the current message through the use of the done signal. However, this does not guarantee that the descriptor for a cylic reference has also finished initialization. Rather than add more complicated logic to wait until all cyclic references have finished initializing, just add a global lock for the entire aberrantLoadMessageDesc function. This slows down performance, but is easier to reason about. Change-Id: I4cdae8b955f71ee40fa6979f5a8d548d9749042c Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/184657 Reviewed-by: Damien Neil <dneil@google.com>