Pārlūkot izejas kodu

libnetwork: Controller: remove mutex for "store"

The store field is only mutated by Controller.initStores(), which is
only called inside the cosntructor (libnetwork.New), so there should be
no need to protect the field with a mutex in non-exported functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 gadu atpakaļ
vecāks
revīzija
ca1307c56e
1 mainītis faili ar 0 papildinājumiem un 6 dzēšanām
  1. 0 6
      libnetwork/store.go

+ 0 - 6
libnetwork/store.go

@@ -11,9 +11,6 @@ import (
 )
 
 func (c *Controller) initStores() error {
-	c.mu.Lock()
-	defer c.mu.Unlock()
-
 	if c.cfg == nil {
 		return nil
 	}
@@ -34,9 +31,6 @@ func (c *Controller) closeStores() {
 }
 
 func (c *Controller) getStore() *datastore.Store {
-	c.mu.Lock()
-	defer c.mu.Unlock()
-
 	return c.store
 }