aboutsummaryrefslogtreecommitdiff
path: root/weed/wdclient/exclusive_locks/exclusive_locker.go
diff options
context:
space:
mode:
authorchrislu <chrislu@roblox.com>2021-12-10 13:24:38 -0800
committerchrislu <chrislu@roblox.com>2021-12-10 13:24:38 -0800
commita2d3f89c7b136780f0ca0400dec3c93c9370df8c (patch)
treeb7a5037df534122cff459c3902a38c270348d3f5 /weed/wdclient/exclusive_locks/exclusive_locker.go
parent991a3dca0d30e980a234c8d8e4c5558625b03325 (diff)
downloadseaweedfs-a2d3f89c7b136780f0ca0400dec3c93c9370df8c.tar.xz
seaweedfs-a2d3f89c7b136780f0ca0400dec3c93c9370df8c.zip
add lock messages
Diffstat (limited to 'weed/wdclient/exclusive_locks/exclusive_locker.go')
-rw-r--r--weed/wdclient/exclusive_locks/exclusive_locker.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/wdclient/exclusive_locks/exclusive_locker.go b/weed/wdclient/exclusive_locks/exclusive_locker.go
index 2f033f36b..725fa307d 100644
--- a/weed/wdclient/exclusive_locks/exclusive_locker.go
+++ b/weed/wdclient/exclusive_locks/exclusive_locker.go
@@ -22,6 +22,7 @@ type ExclusiveLocker struct {
isLocking bool
masterClient *wdclient.MasterClient
lockName string
+ message string
}
func NewExclusiveLocker(masterClient *wdclient.MasterClient, lockName string) *ExclusiveLocker {
@@ -87,6 +88,7 @@ func (l *ExclusiveLocker) RequestLock(clientName string) {
PreviousLockTime: atomic.LoadInt64(&l.lockTsNs),
LockName: l.lockName,
ClientName: clientName,
+ Message: l.message,
})
if err == nil {
atomic.StoreInt64(&l.token, resp.Token)
@@ -123,3 +125,7 @@ func (l *ExclusiveLocker) ReleaseLock() {
atomic.StoreInt64(&l.token, 0)
atomic.StoreInt64(&l.lockTsNs, 0)
}
+
+func (l *ExclusiveLocker) SetMessage(message string) {
+ l.message = message
+}