Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Locker.Locked() for windows #212

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions lockfile_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,29 @@ import (
)

func getLockFile(path string, ro bool) (Locker, error) {
return &lockfile{}, nil
return &lockfile{locked: false}, nil
}

type lockfile struct {
mu sync.Mutex
file string
mu sync.Mutex
file string
locked bool
}

func (l *lockfile) Lock() {
l.mu.Lock()
l.locked = true
}

func (l *lockfile) Unlock() {
l.locked = false
l.mu.Unlock()
}

func (l *lockfile) Locked() bool {
return l.locked
}

func (l *lockfile) Modified() (bool, error) {
return false, nil
}
Expand Down