thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeking3 <...@git.apache.org>
Subject [GitHub] thrift pull request #1196: THRIFT-3891 TNonblockingServer configured with mo...
Date Mon, 20 Feb 2017 14:10:26 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message