bneradt commented on code in PR #14062:
URL: https://github.com/apache/trafficserver/pull/14062#discussion_r4568077151


##########
plugins/experimental/stek_share/common.h:
##########
@@ -64,10 +74,22 @@ class PluginThreads
     return shut_down;
   }
 
+  // Like std::this_thread::sleep_for, but terminate() wakes it early so
+  // shutdown does not wait out a long sleep.
+  template <class Rep, class Period>
+  void
+  sleep_for(const std::chrono::duration<Rep, Period> &duration)

Review Comment:
   Minor: both call sites would work with a plain `void 
sleep_for(std::chrono::milliseconds duration)`, since `std::chrono::seconds` 
converts to `milliseconds` implicitly. That drops the template (the project 
guide says to avoid templates unless they're needed) and keeps the definition 
out of the header's interface.



##########
plugins/experimental/stek_share/common.h:
##########
@@ -64,10 +74,22 @@ class PluginThreads
     return shut_down;
   }
 
+  // Like std::this_thread::sleep_for, but terminate() wakes it early so
+  // shutdown does not wait out a long sleep.
+  template <class Rep, class Period>
+  void
+  sleep_for(const std::chrono::duration<Rep, Period> &duration)

Review Comment:
   Minor: both call sites would work with a plain `void 
sleep_for(std::chrono::milliseconds duration)`, since `std::chrono::seconds` 
converts to `milliseconds` implicitly. That drops the template, and the project 
guide says to avoid templates unless they are needed.



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

Reply via email to