You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "BewareMyPower (via GitHub)" <gi...@apache.org> on 2023/02/03 06:10:07 UTC

[GitHub] [pulsar-client-cpp] BewareMyPower commented on a diff in pull request #185: [fix] Avoid resource leakage of AckGroupingTracker

BewareMyPower commented on code in PR #185:
URL: https://github.com/apache/pulsar-client-cpp/pull/185#discussion_r1095389037


##########
lib/AckGroupingTrackerEnabled.h:
##########
@@ -71,6 +71,15 @@ class AckGroupingTrackerEnabled : public AckGroupingTracker {
     //! Method for scheduling grouping timer.
     void scheduleTimer();
 
+    //! State
+    enum State
+    {
+        NotStarted,
+        Ready,
+        Closed,
+    };
+    std::atomic<State> state_;

Review Comment:
   The `NotStarted` and `Closed` states are never used, would it better to just use a `atomic_bool` here?



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org