| 171 | } |
| 172 | |
| 173 | void ThriftServer::ThriftServerEventProcessor::preServe() { |
| 174 | // Acquire the signal lock to ensure that StartAndWaitForServer is |
| 175 | // waiting on signal_cond_ when we notify. |
| 176 | lock_guard<mutex> lock(signal_lock_); |
| 177 | signal_fired_ = true; |
| 178 | |
| 179 | // This is the (only) success path - if this is not reached within TIMEOUT_MS, |
| 180 | // StartAndWaitForServer will indicate failure. |
| 181 | thrift_server_->started_ = true; |
| 182 | |
| 183 | // Should only be one thread waiting on signal_cond_, but wake all just in case. |
| 184 | signal_cond_.NotifyAll(); |
| 185 | } |
| 186 | |
| 187 | // This thread-local variable contains the current connection context for whichever |
| 188 | // thrift server is currently serving a request on the current thread. This includes |