Skip to content

Commit 8746917

Browse files
Use a reference instead of a pointer for MutexLock.
#codehealth PiperOrigin-RevId: 834623818
1 parent 36b748c commit 8746917

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/prediction/user_history_predictor.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,17 +1360,15 @@ std::vector<Result> UserHistoryPredictor::Predict(
13601360
// MaybeProcessPartialRevertEntry is marked as const so
13611361
// as to access it Predict(), but it updates the contents of dic_, so
13621362
// WriterLock is required.
1363-
// TODO(b/438604511): Use dic_mutex_ (w/o &) when Abseil LTS supports it.
1364-
absl::WriterMutexLock lock(&dic_mutex_);
1363+
absl::WriterMutexLock lock(dic_mutex_);
13651364
MaybeProcessPartialRevertEntry(request);
13661365
}
13671366

13681367
// The const-method accessing the contents in `dic_` should be protected
13691368
// with ReaderLock, as the Entry in `dic_` may be updated in different thread.
13701369
// We wants to use ReaderLock instead of MutexLock as the
13711370
// actual decoding process is much slower than ReaderLock.
1372-
// TODO(b/438604511): Use dic_mutex_ (w/o &) when Abseil LTS supports it.
1373-
absl::ReaderMutexLock lock(&dic_mutex_);
1371+
absl::ReaderMutexLock lock(dic_mutex_);
13741372

13751373
if (!ShouldPredict(request)) {
13761374
return {};

0 commit comments

Comments
 (0)