summaryrefslogtreecommitdiff
path: root/libpod/lock/shm_lock_manager_linux.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-08-23 13:48:07 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-01-04 09:51:09 -0500
commita364b656eaef1be5329abfd02d3fcd2dbcd37d64 (patch)
tree454478de97e3d1831b6b64acdeaeafac9b9052e7 /libpod/lock/shm_lock_manager_linux.go
parente73484c176839b2f2adf3d07cc09222a7b75bf69 (diff)
downloadpodman-a364b656eaef1be5329abfd02d3fcd2dbcd37d64.tar.gz
podman-a364b656eaef1be5329abfd02d3fcd2dbcd37d64.tar.bz2
podman-a364b656eaef1be5329abfd02d3fcd2dbcd37d64.zip
Add lock manager to libpod runtime
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/lock/shm_lock_manager_linux.go')
-rw-r--r--libpod/lock/shm_lock_manager_linux.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/libpod/lock/shm_lock_manager_linux.go b/libpod/lock/shm_lock_manager_linux.go
index 974431a13..2c0ea611a 100644
--- a/libpod/lock/shm_lock_manager_linux.go
+++ b/libpod/lock/shm_lock_manager_linux.go
@@ -73,13 +73,17 @@ func (l *SHMLock) ID() uint32 {
}
// Lock acquires the lock.
-func (l *SHMLock) Lock() error {
- return l.manager.locks.LockSemaphore(l.lockID)
+func (l *SHMLock) Lock() {
+ if err := l.manager.locks.LockSemaphore(l.lockID); err != nil {
+ panic(err.Error())
+ }
}
// Unlock releases the lock.
-func (l *SHMLock) Unlock() error {
- return l.manager.locks.UnlockSemaphore(l.lockID)
+func (l *SHMLock) Unlock() {
+ if err := l.manager.locks.UnlockSemaphore(l.lockID); err != nil {
+ panic(err.Error())
+ }
}
// Free releases the lock, allowing it to be reused.