|
|
@ -78,7 +78,7 @@ func (f *FileLock) Unlock() error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (f *FileLock) LockWithTimeout(tm time.Duration, Exclusive bool) error {
|
|
|
|
func (f *FileLock) LockWithTimeout(tm time.Duration, Exclusive bool) error {
|
|
|
|
return stario.StopUntilTimeout(tm, func(tmout chan struct{}) error {
|
|
|
|
return stario.WaitUntilTimeout(tm, func(tmout chan struct{}) error {
|
|
|
|
err := f.Lock(Exclusive)
|
|
|
|
err := f.Lock(Exclusive)
|
|
|
|
select {
|
|
|
|
select {
|
|
|
|
case <-tmout:
|
|
|
|
case <-tmout:
|
|
|
|