using an temp variable for lkID in unlock method

This commit is contained in:
gezimbll
2025-06-09 15:14:19 +02:00
committed by Dan Christian Bogos
parent 32a02a694a
commit f3ca5b0016
4 changed files with 19 additions and 8 deletions

View File

@@ -104,8 +104,9 @@ func (ip *IPProfile) unlock() {
if ip.lkID == utils.EmptyString {
return
}
guardian.Guardian.UnguardIDs(ip.lkID)
tmp := ip.lkID
ip.lkID = utils.EmptyString
guardian.Guardian.UnguardIDs(tmp)
}
// IPUsage represents an usage counted.
@@ -206,8 +207,10 @@ func (ip *IP) unlock() {
if ip.lkID == utils.EmptyString {
return
}
guardian.Guardian.UnguardIDs(ip.lkID)
tmp := ip.lkID
ip.lkID = utils.EmptyString
guardian.Guardian.UnguardIDs(tmp)
}
type IPWithAPIOpts struct {

View File

@@ -119,8 +119,9 @@ func (sqp *StatQueueProfile) unlock() {
if sqp.lkID == utils.EmptyString {
return
}
guardian.Guardian.UnguardIDs(sqp.lkID)
tmp := sqp.lkID
sqp.lkID = utils.EmptyString
guardian.Guardian.UnguardIDs(tmp)
}
// isLocked returns the locks status of this StatQueueProfile
@@ -320,8 +321,10 @@ func (sq *StatQueue) unlock() {
if sq.lkID == utils.EmptyString {
return
}
guardian.Guardian.UnguardIDs(sq.lkID)
tmp := sq.lkID
sq.lkID = utils.EmptyString
guardian.Guardian.UnguardIDs(tmp)
}
// isLocked returns the locks status of this StatQueue

View File

@@ -114,8 +114,10 @@ func (rp *ResourceProfile) unlock() {
if rp.lkID == utils.EmptyString {
return
}
guardian.Guardian.UnguardIDs(rp.lkID)
tmp := rp.lkID
rp.lkID = utils.EmptyString
guardian.Guardian.UnguardIDs(tmp)
}
// isLocked returns the locks status of this resourceProfile
@@ -228,8 +230,9 @@ func (r *Resource) unlock() {
if r.lkID == utils.EmptyString {
return
}
guardian.Guardian.UnguardIDs(r.lkID)
tmp := r.lkID
r.lkID = utils.EmptyString
guardian.Guardian.UnguardIDs(tmp)
}
// isLocked returns the locks status of this resource

View File

@@ -117,8 +117,9 @@ func (tp *ThresholdProfile) unlock() {
if tp.lkID == utils.EmptyString {
return
}
guardian.Guardian.UnguardIDs(tp.lkID)
tmp := tp.lkID
tp.lkID = utils.EmptyString
guardian.Guardian.UnguardIDs(tmp)
}
// isLocked returns the locks status of this ThresholdProfile
@@ -209,8 +210,9 @@ func (t *Threshold) unlock() {
if t.lkID == utils.EmptyString {
return
}
guardian.Guardian.UnguardIDs(t.lkID)
tmp := t.lkID
t.lkID = utils.EmptyString
guardian.Guardian.UnguardIDs(tmp)
}
// isLocked returns the locks status of this threshold