summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2023-07-14 11:02:56 -0400
committerWill Hawkins <[email protected]>2023-07-14 11:05:55 -0400
commitd27187215da1930c43a22c542d18f7578671ed74 (patch)
tree7add5e09413e9b0c6d93c87f5e5fc3a168dc2e33
parent0a4cc0474df9854851a95e1b283468d6d62344b8 (diff)
Use defer to unlock probe data point channel lock
This approach *seems* like a good idea. Signed-off-by: Will Hawkins <[email protected]>
-rw-r--r--rpm/rpm.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpm/rpm.go b/rpm/rpm.go
index ff483ff..6e14418 100644
--- a/rpm/rpm.go
+++ b/rpm/rpm.go
@@ -287,6 +287,7 @@ func ResponsivenessProber[BucketType utilities.Number](
}
dataPointsLock.Lock()
+ defer dataPointsLock.Unlock()
// Now we have our four data points (three in the foreign probe data point and one in the self probe data point)
if dataPoints != nil {
measurement := ResponsivenessProbeResult{
@@ -298,7 +299,6 @@ func ResponsivenessProber[BucketType utilities.Number](
Measure: utilities.Some[ResponsivenessProbeResult](measurement),
}
}
- dataPointsLock.Unlock()
}()
}
if debug.IsDebug(debugging.Level) {