| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. |
| 4 |
| 5 package lib |
| 6 |
| 7 import ( |
| 8 "os" |
| 9 |
| 10 "github.com/luci/luci-go/common/errors" |
| 11 ) |
| 12 |
| 13 // TODO(charliea): Add timeout parameter to this function. |
| 14 func AcquireExclusiveLock(path string) error { |
| 15 _, err := os.OpenFile(path, os.O_APPEND, 0666) |
| 16 if os.IsNotExist(err) { |
| 17 return errors.Reason("lock file does not exist", path).Err() |
| 18 } |
| 19 |
| 20 panic("implement lock acquisition") |
| 21 } |
| OLD | NEW |