Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conntrack: replace std::mutex with Thread::MutexBasicLockable #1095

Merged

Conversation

mhofstetter
Copy link
Member

@mhofstetter mhofstetter commented Jan 3, 2025

Upstream Envoy linting prevents usages of std::mutex in favor of Thread::MutexBasicLockable.

This error occurred while trying to cleanup the imports - and therefore adding the direct dependency to <mutex>.

ERROR: From ./cilium/conntrack.h
ERROR: ./cilium/conntrack.h:7: Don't use <mutex> or <condition_variable*>, switch to Thread::MutexBasicLockable in source/common/common/thread.h
ERROR: From ./cilium/conntrack.cc
ERROR: ./cilium/conntrack.cc:9: Don't use <mutex> or <condition_variable*>, switch to Thread::MutexBasicLockable in source/common/common/thread.h
ERROR: check format failed. diff has been applied'

See https://github.com/envoyproxy/envoy/blob/main/tools/code_format/check_format.py#L605-L610

report_error(
  "Don't use <mutex> or <condition_variable*>, switch to "
  "Thread::MutexBasicLockable in source/common/common/thread.h")

See #1089

Upstream Envoy linting prevents usages of `std::mutex` in favor of
`Thread::MutexBasicLockable`.

See https://github.com/envoyproxy/envoy/blob/main/tools/code_format/check_format.py#L605-L610

```
report_error(
  "Don't use <mutex> or <condition_variable*>, switch to "
  "Thread::MutexBasicLockable in source/common/common/thread.h")
```

This error occurred while trying to cleanup the imports - and therefore
adding the direct dependency to `<mutex>`.

See cilium#1089

Signed-off-by: Marco Hofstetter <[email protected]>
@mhofstetter mhofstetter force-pushed the pr/mhofstetter/mutex-threadlib branch from 0430df5 to 626eafd Compare January 3, 2025 16:33
@mhofstetter mhofstetter requested a review from jrajahalme January 6, 2025 08:09
@mhofstetter mhofstetter marked this pull request as ready for review January 6, 2025 08:10
@mhofstetter mhofstetter requested a review from a team as a code owner January 6, 2025 08:10
@mhofstetter mhofstetter added this pull request to the merge queue Jan 7, 2025
Merged via the queue into cilium:main with commit 0d32758 Jan 7, 2025
5 checks passed
@mhofstetter mhofstetter deleted the pr/mhofstetter/mutex-threadlib branch January 7, 2025 08:28
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