Skip to content

Commit

Permalink
Added lock in callback
Browse files Browse the repository at this point in the history
Signed-off-by: Saurabh Deoras <[email protected]>
  • Loading branch information
sdeoras committed Feb 15, 2018
1 parent ec088b7 commit ab5c48c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions osdconfig/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func (manager *configManager) execNodeCallbacks(f CallbackNodeConfigFunc, data *
// this callback simply receives data from kvdb and reflects it on a channel it receives in opaque
func (manager *configManager) kvdbCallback(prefix string,
opaque interface{}, kvp *kvdb.KVPair, err error) error {
manager.Lock()
defer manager.Unlock()

c, ok := opaque.(*dataToKvdb)
if !ok {
return fmt.Errorf("opaque value type is incorrect")
Expand Down

0 comments on commit ab5c48c

Please sign in to comment.