| 126 | } |
| 127 | |
| 128 | void ServerThread::preServe() { |
| 129 | // We bound to the port successfully, and are about to start serving requests |
| 130 | serverState_->bindSuccessful(port_); |
| 131 | |
| 132 | // Set the real server event handler (replacing ourself) |
| 133 | std::shared_ptr<server::TServerEventHandler> serverEventHandler |
| 134 | = serverState_->getServerEventHandler(); |
| 135 | server_->setServerEventHandler(serverEventHandler); |
| 136 | |
| 137 | // Notify the main thread that we have successfully started serving requests |
| 138 | concurrency::Synchronized s(serverMonitor_); |
| 139 | serving_ = true; |
| 140 | serverMonitor_.notify(); |
| 141 | |
| 142 | // Invoke preServe() on the real event handler, since we ate |
| 143 | // the original preServe() event. |
| 144 | if (serverEventHandler) { |
| 145 | serverEventHandler->preServe(); |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | } // apache::thrift::test |
nothing calls this directly
no test coverage detected