You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "masaori335 (via GitHub)" <gi...@apache.org> on 2023/02/20 02:11:30 UTC

[GitHub] [trafficserver] masaori335 commented on a diff in pull request #9442: Replace exclusive locks with rwlocks in hostdb

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


##########
iocore/hostdb/P_RefCountCache.h:
##########
@@ -169,7 +170,7 @@ template <class C> class RefCountCachePartition
 
   hash_type &get_map();
 
-  Ptr<ProxyMutex> lock; // Lock
+  ink_rwlock lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP;

Review Comment:
   Pretty interesting change. Could you use `std::shared_mutex` here? 
   We can do it later, but using `std::shared_mutex` will make it easier to apply `ts::bravo::shared_mutex` or other reader-writer lock improvements in the future, IMO.



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