Sitelet https://github.com/google/re2/pull/665
Skip to content

re2: use new absl::Mutex method names and MutexLock(Mutex&) - #665

Open
edwinchenloo wants to merge 1 commit into
google:mainfrom
edwinchenloo:absl-mutex-api
Open

edwinchenloo wants to merge 1 commit into
google:mainfrom
edwinchenloo:absl-mutex-api

Conversation

@edwinchenloo

@edwinchenloo edwinchenloo commented Sep 30, 2026 •

Copy link
Copy Markdown

Follow-up to 972a15c ("re2: remove unnecessary & in MutexLock usage"), finishing the update for the mid-2025 Abseil API changes:

  • re2/dfa.cc: RWLocker now uses lock_shared/unlock_shared/lock/unlock instead of the deprecated ReaderLock/ReaderUnlock/WriterLock/WriterUnlock.
  • re2/regexp.cc: pass *ref_mutex() to absl::MutexLock (the reference constructor) instead of the pointer.

Starting with Abseil LTS 20260107, the old method names and the pointer MutexLock constructor are marked [[deprecated]], so building RE2 against current Abseil emits deprecation warnings in dfa.cc and regexp.cc (and fails outright under -Werror). This change removes those warnings. It doesn't raise the minimum Abseil version: 972a15c already requires 20250814, which provides both the old and new APIs.

Tested with bazel test //:all (20/20 pass).

@google-cla

google-cla Bot commented Sep 30, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Replace the deprecated ReaderLock/ReaderUnlock/WriterLock/WriterUnlock
with lock_shared/unlock_shared/lock/unlock, and pass a reference rather
than a pointer to absl::MutexLock in regexp.cc, completing the update
for the Abseil API churn from mid-2025.

@dneto0 dneto0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essentially the same as #644

cc: @adonovan

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants