You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/12/02 15:40:45 UTC

[GitHub] [geode-native] gaussianrecurrence commented on a change in pull request #812: GEODE-9324: Remove ACE_Task refereces

gaussianrecurrence commented on a change in pull request #812:
URL: https://github.com/apache/geode-native/pull/812#discussion_r761217916



##########
File path: cppcache/integration-test/ThinClientSecurityHelper.hpp
##########
@@ -198,18 +198,26 @@ class putThread : public ACE_Task_Base {
   }
 
   void start() {
-    m_run = true;
-    activate(THR_NEW_LWP | THR_JOINABLE, m_numthreads);
+    for(auto i = 0; i < m_numthreads; ++i) {
+      threads_.emplace_back([this](){
+        run();
+      });
+    }
+  }
+
+  void wait() {
+    for(auto& thread : threads_) {
+      if(thread.joinable()) {
+        thread.join();
+      }
+    }
   }
 
   void stop() {
-    if (m_run) {
-      m_run = false;

Review comment:
       Thanks for pointing this out. Thing is there is no mechanism now to tell the task to end, as there wasn't before. Because m_run was not used, except as a mean to tell whether or not the thread was started, but that was not necessary as the thread was run in a controlled environment and it was not going to be stopped before it was started, and this last part is not different now.




-- 
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: notifications-unsubscribe@geode.apache.org

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