From cc0712edabdbd773f3d4168868410924473bdd3a Mon Sep 17 00:00:00 2001 From: James Bardin Date: Mon, 9 Jan 2017 18:00:05 -0500 Subject: [PATCH] add state.Locker interface Changed from state.StateLocker to remove the stutter. State implementations can provide Lock/Unlock methods to lock the state file. Remote clients can also provide these same methods, which will be called through remote.State. --- state/state.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/state/state.go b/state/state.go index 747723e193..210eb62c8a 100644 --- a/state/state.go +++ b/state/state.go @@ -40,3 +40,9 @@ type StateRefresher interface { type StatePersister interface { PersistState() error } + +// Locker is implemented to lock state during command execution. +type Locker interface { + Lock(reason string) error + Unlock() error +}