Github user jeking3 commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1196#discussion_r102025071
  
    --- Diff: lib/cpp/src/thrift/server/TNonblockingServer.cpp ---
    @@ -1566,24 +1562,26 @@ void 
TNonblockingIOThread::setCurrentThreadHighPriority(bool value) {
     }
     
     void TNonblockingIOThread::run() {
    -  if (eventBase_ == NULL)
    +  if (eventBase_ == NULL) {
         registerEvents();
    -
    -  GlobalOutput.printf("TNonblockingServer: IO thread #%d entering 
loop...", number_);
    -
    +  }
       if (useHighPriority_) {
         setCurrentThreadHighPriority(true);
       }
     
    -  // Run libevent engine, never returns, invokes calls to eventHandler
    -  event_base_loop(eventBase_, 0);
    +  if (eventBase_ != NULL)
    +  {
    +    GlobalOutput.printf("TNonblockingServer: IO thread #%d entering 
loop...", number_);
    +    // Run libevent engine, never returns, invokes calls to eventHandler
    +    event_base_loop(eventBase_, 0);
     
    -  if (useHighPriority_) {
    -    setCurrentThreadHighPriority(false);
    -  }
    +    if (useHighPriority_) {
    +      setCurrentThreadHighPriority(false);
    +    }
     
    -  // cleans up our registered events
    -  cleanupEvents();
    +    // cleans up our registered events
    +    cleanupEvents();
    +  }
     
       GlobalOutput.printf("TNonblockingServer: IO thread #%d run() done!", 
number_);
    --- End diff --
    
    You can install your own GlobalOutput handler.  The hooks should be in the 
top level thrift header.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to