MCPcopy Create free account
hub / github.com/apache/thrift / initBufferAndWriteThread

Method initBufferAndWriteThread

lib/cpp/src/thrift/transport/TFileTransport.cpp:170–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170bool TFileTransport::initBufferAndWriteThread() {
171 if (bufferAndThreadInitialized_) {
172 T_ERROR("%s", "Trying to double-init TFileTransport");
173 return false;
174 }
175
176 if (!writerThread_.get()) {
177 writerThread_ = threadFactory_.newThread(
178 apache::thrift::concurrency::FunctionRunner::create(startWriterThread, this));
179 writerThread_->start();
180 }
181
182 dequeueBuffer_ = new TFileTransportBuffer(eventBufferSize_);
183 enqueueBuffer_ = new TFileTransportBuffer(eventBufferSize_);
184 bufferAndThreadInitialized_ = true;
185
186 return true;
187}
188
189void TFileTransport::write(const uint8_t* buf, uint32_t len) {
190 if (readOnly_) {

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
newThreadMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected