using an temp variable for lkID in unlock method

This commit is contained in:
gezimbll
2025-06-09 15:39:35 +02:00
committed by Dan Christian Bogos
parent 725c56592c
commit d8757d017d
3 changed files with 12 additions and 6 deletions

View File

@@ -122,8 +122,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
@@ -275,8 +276,9 @@ 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

@@ -113,8 +113,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
@@ -192,8 +193,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

View File

@@ -56,8 +56,9 @@ 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
@@ -92,8 +93,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