masaori335 commented on code in PR #12794:
URL: https://github.com/apache/trafficserver/pull/12794#discussion_r3020431876
##########
src/iocore/cache/StripeSM.h:
##########
@@ -253,6 +267,24 @@ extern std::atomic<int> gnstripes;
extern ClassAllocator<OpenDirEntry, false> openDirEntryAllocator;
extern unsigned short *vol_hash_table;
+template <typename U, typename Func>
+U
+StripeSM::read_op(Func read_op) const
+{
+ ts::bravo::shared_lock lock(_shared_mutex);
+
+ return read_op();
+}
+
+template <typename U, typename Func>
+U
+StripeSM::write_op(Func write_op)
+{
+ std::lock_guard lock(_shared_mutex);
+
+ return write_op();
+}
Review Comment:
it's no problem. At least, compiler doesn't make it error.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]