You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/11/07 02:04:18 UTC
[GitHub] [trafficserver] masaori335 commented on a diff in pull request #9172: TSan: Fix data race of hostdb_current_timestamp
masaori335 commented on code in PR #9172:
URL: https://github.com/apache/trafficserver/pull/9172#discussion_r1014946936
##########
iocore/hostdb/HostDB.cc:
##########
@@ -1479,7 +1479,7 @@ HostDBContinuation::backgroundEvent(int /* event ATS_UNUSED */, Event * /* e ATS
return EVENT_CONT;
}
- if ((hostdb_current_timestamp - hostdb_last_timestamp) > hostdb_hostfile_check_interval) {
+ if ((hostdb_current_timestamp.load() - hostdb_last_timestamp) > hostdb_hostfile_check_interval) {
Review Comment:
I thought it too, but clang (15.0.1) complains without the `.load()`.
```
HostDB.cc:1482:33: error: invalid operands to binary expression ('std::atomic<ts_time>' (aka 'atomic<time_point<std::chrono::system_clock>>') and 'ts_time' (aka 'time_point<std::chrono::system_clock>'))
if ((hostdb_current_timestamp - hostdb_last_timestamp) > hostdb_hostfile_check_interval) {
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/llvm/include/c++/v1/__iterator/reverse_iterator.h:296:1: note: candidate template ignored: could not match 'reverse_iterator' against 'atomic'
operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
^
/usr/local/opt/llvm/include/c++/v1/__chrono/duration.h:435:1: note: candidate template ignored: could not match 'duration' against 'atomic'
operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
^
/usr/local/opt/llvm/include/c++/v1/__chrono/time_point.h:227:1: note: candidate template ignored: could not match 'time_point' against 'atomic'
operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
^
/usr/local/opt/llvm/include/c++/v1/__chrono/time_point.h:238:1: note: candidate template ignored: could not match 'time_point' against 'atomic'
operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
^
/usr/local/opt/llvm/include/c++/v1/__iterator/move_iterator.h:283:6: note: candidate template ignored: could not match 'move_iterator' against 'atomic'
auto operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
^
/usr/local/opt/llvm/include/c++/v1/__iterator/wrap_iter.h:245:6: note: candidate template ignored: could not match '__wrap_iter' against 'atomic'
auto operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
^
/usr/local/opt/llvm/include/c++/v1/__ios/fpos.h:61:11: note: candidate template ignored: could not match 'fpos' against 'atomic'
streamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {
^
1 error generated.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org