-
Notifications
You must be signed in to change notification settings - Fork 845
TSAN fix for fake_global_for_ink_queue. #9183
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
Conversation
|
Fixes this warning: |
|
Looks like this overlaps with #9168 . |
9605fd3 to
0e66ca8
Compare
| inline void | ||
| dummy_forced_read(void *mem) | ||
| { | ||
| static_cast<void>(*const_cast<int volatile *>(reinterpret_cast<int *>(mem))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use [[maybe_unused]] instead of static_cast<void>()?
Also, you can static_cast to int * because it's a void *.
Finally, force_read might be a better name. There's no longer a dummy variable involved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer code that's less rather than more obscure. In any case, seems misleading to say something is maybe unused when it's definitely unused.
We should never miss a chance to use a static_cast apparently.
It's dummy in the sense that we are reading a memory location as some sort of fragile, ratchet, half-assed memory fence, rather than to read the value of a memory location. Instead of using the more portable code I wrote to replace this mess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[[maybe_unused]] is the official replacement in C++17 for casting to void to avoid discarding computation due to optimization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cppreference.com as much as I does not seem to have gotten the memo you got about [[maybe_unused]]: https://en.cppreference.com/w/cpp/language/attributes/maybe_unused
* asf/master: (28 commits) Human readable timestamp for traffic_ctl config status (apache#9440) traffic_ctl - Remove legacy/pretty format output options (apache#9471) TSAN fix for fake_global_for_ink_queue. (apache#9183) libswoc: replace TextView in src/tscore/HostLookup.cc (apache#9437) records.yaml: Make sure when a string field is set to NULL then this (apache#9472) QUIC: Make sure the some of the quic configs get set into the quiche impl. (apache#9477) Replace httpbin with go-httpbin (apache#9475) Ethread::process_event(): make sure event mutex is unlocked before freeing event. (apache#9433) Use deprecated OpenSSL APIs for MD5 and SHA256 if available (apache#9469) Adds a --enable-lto option (Link Time Optimization) (apache#9464) traffic_ctl: Add support to monitor metrics. (apache#9423) QUIC: Make some adjustment to the qlog configuration (apache#9461) Added more debugging output for the xdebug plugin (apache#9467) Build: remove configure check for sys/mount.h, use C++17 builtin. (apache#9463) Fix SSLSessionDup for old OpenSSL and BoringSSL (apache#9444) Run autest tls_hooks17 and tls_hooks18 on BoringSSL build (apache#9455) Stabilize autest tls_hook18 (apache#9454) Fix parameter parser in ssl_hook_test plugin (apache#9453) Use SSL_get1_peer_certificate on OpenSSL3 build (apache#9460) records.yaml - Make some changes on the convert script. (apache#9466) ...
No description provided.