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/01 05:56:13 UTC

[GitHub] [trafficserver] masaori335 commented on a diff in pull request #9169: TSan: Fix data race of RecMutex::thread_holding

masaori335 commented on code in PR #9169:
URL: https://github.com/apache/trafficserver/pull/9169#discussion_r1010094027


##########
src/records/RecMutex.cc:
##########
@@ -45,7 +45,7 @@ rec_mutex_acquire(RecMutex *m)
 {
   ink_thread this_thread = ink_thread_self();
 
-  if (m->thread_holding != this_thread) {
+  if (!pthread_equal(m->thread_holding, this_thread)) {

Review Comment:
   Using `pthread_equal` is recommended to compare `pthread_t` (`ink_thread` is an alias of `pthread_t`).



-- 
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