Implement reader-writer locks to allow allow multiple readers to hold the lock in parallel. * The locks are still based on fcntl(2). * Changing the lock from a reader to a writer and vice versa will block on the syscall. * A writer lock can be held only by one process. To protect against concurrent accesses by gourtines within the same process space, use a writer mutex. * Extend the Locker interface with the `RLock()` method to acquire a reader lock. If the lock is set to be read-only, all calls to `Lock()` will be redirected to `RLock()`. A reader lock is only released via fcntl(2) when all gourtines within the same process space have unlocked it. This is done via an internal counter which is protected (among other things) by an internal state mutex. * Panic on violations of the lock protocol, namely when calling `Unlock()` on an unlocked lock. This helps detecting violations in the code but also protects the storage from corruption. Doing this has revealed some bugs fixed in ealier commits. Signed-off-by: Valentin Rothberg <rothberg@redhat.com> |
||
|---|---|---|
| .. | ||
| testdata | ||
| README.md | ||
| archive.go | ||
| archive_19.go | ||
| archive_110.go | ||
| archive_ffjson.go | ||
| archive_linux.go | ||
| archive_linux_test.go | ||
| archive_other.go | ||
| archive_test.go | ||
| archive_unix.go | ||
| archive_unix_test.go | ||
| archive_windows.go | ||
| archive_windows_test.go | ||
| changes.go | ||
| changes_linux.go | ||
| changes_other.go | ||
| changes_posix_test.go | ||
| changes_test.go | ||
| changes_unix.go | ||
| changes_windows.go | ||
| copy.go | ||
| copy_unix.go | ||
| copy_unix_test.go | ||
| copy_windows.go | ||
| diff.go | ||
| diff_test.go | ||
| example_changes.go | ||
| time_linux.go | ||
| time_unsupported.go | ||
| utils_test.go | ||
| whiteouts.go | ||
| wrap.go | ||
| wrap_test.go | ||
README.md
This code provides helper functions for dealing with archive files.