fix lock bug for componentGlobalsRegistry

Signed-off-by: Siyuan Zhang <sizhang@google.com>
This commit is contained in:
Siyuan Zhang
2024-07-05 15:50:10 +00:00
parent 5837de2796
commit d31aebe572

View File

@@ -135,8 +135,8 @@ func NewComponentGlobalsRegistry() *componentGlobalsRegistry {
}
func (r *componentGlobalsRegistry) Reset() {
r.mutex.RLock()
defer r.mutex.RUnlock()
r.mutex.Lock()
defer r.mutex.Unlock()
r.componentGlobals = make(map[string]*ComponentGlobals)
r.emulationVersionConfig = nil
r.featureGatesConfig = nil