Lock places an advisory write lock on the file, blocking until it can be locked. If Lock returns nil, no other process will be able to place a read or write lock on the file until this process exits, closes f, or calls Unlock on it.
(path string)
| 37 | // If Lock returns nil, no other process will be able to place a read or write lock on the file until |
| 38 | // this process exits, closes f, or calls Unlock on it. |
| 39 | func Lock(path string) (file *os.File, err error) { |
| 40 | return commonlock(path, writeLock) |
| 41 | } |
| 42 | |
| 43 | // ReadOnlyLock places an advisory read lock on the file, blocking until it can be locked. |
| 44 | // |
searching dependent graphs…