diff --git a/pkg/lockfile/lockfile.go b/pkg/lockfile/lockfile.go index 77bd0aa070..f639357f4a 100644 --- a/pkg/lockfile/lockfile.go +++ b/pkg/lockfile/lockfile.go @@ -40,9 +40,6 @@ type Locker interface { // IsReadWrite() checks if the lock file is read-write IsReadWrite() bool - // Locked() checks if lock is locked for writing by a thread in this process - Locked() bool - // AssertLocked() can be used by callers that _know_ that they hold the lock (for reading or writing), for sanity checking. // It might do nothing at all, or it may panic if the caller is not the owner of this lock. AssertLocked() diff --git a/pkg/lockfile/lockfile_unix.go b/pkg/lockfile/lockfile_unix.go index 1ec6c458b9..21378e9420 100644 --- a/pkg/lockfile/lockfile_unix.go +++ b/pkg/lockfile/lockfile_unix.go @@ -213,13 +213,6 @@ func (l *lockfile) Unlock() { l.stateMutex.Unlock() } -// Locked checks if lockfile is locked for writing by a thread in this process. -func (l *lockfile) Locked() bool { - l.stateMutex.Lock() - defer l.stateMutex.Unlock() - return l.locked && (l.locktype == unix.F_WRLCK) -} - func (l *lockfile) AssertLocked() { // DO NOT provide a variant that returns the value of l.locked. // diff --git a/pkg/lockfile/lockfile_windows.go b/pkg/lockfile/lockfile_windows.go index 9e9d22f59d..cc898d82b5 100644 --- a/pkg/lockfile/lockfile_windows.go +++ b/pkg/lockfile/lockfile_windows.go @@ -47,10 +47,6 @@ func (l *lockfile) Unlock() { l.mu.Unlock() } -func (l *lockfile) Locked() bool { - return l.locked -} - func (l *lockfile) AssertLocked() { // DO NOT provide a variant that returns the value of l.locked. //