heronr opened a new pull request #4084: [c++][pulsar-client-cpp] Protect 
against double joining the worker thread in ExecutorService::close()
URL: https://github.com/apache/pulsar/pull/4084
 
 
   ### Motivation
   
   This change is to prevent a crash on Windows when an ExecutorService is 
closed before it is destroyed. Since the ExecutorService destructor calls 
close(), join() will be invoked on the worker thread twice and this call is not 
re-entrant on Windows.
   
   ### Modifications
   
   In ExecutorService::close(), the work_ pointer's validity is checked before 
taking any action. If the work_ pointer is valid, the thread must still be 
active and joining it is safe. If it is null, then the Service has already been 
closed and no actions need to be taken.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): No
     - The public API: No
     - The schema: No
     - The default values of configurations: No
     - The wire protocol: No
     - The rest endpoints: No
     - The admin cli options: No
     - Anything that affects deployment: No
   
   ### Documentation
   
     - Does this pull request introduce a new feature? No
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to