mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-08 03:08:53 +00:00
709b69f14c
Set closing_ to true before we wake up the writer thread in the destructor. This way the writer thread flushes the data and exits when it is woken up. Previously the writer thread could end up going through 2 full timeout cycles before exiting. The writer thread could wake up, notice it has nothing to do since closing_ is not set, and immediately go back to sleep. The destructor would then proceed to call flush(), which would wait for the writer thread to wake up (1 full time out) and clear the forceFlush_ flag. After flush returns, the destructor would set closing_. It could take the writer thread another full timeout to wake up again and process this flag. There were also some points where the worker threads would detect the closing_ state in their loops and automatically close the file, but did not zero out the file descriptor, then the destructer attempted to close the same file. Fix by simply zeroing out the fd_ at these points. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005154 13f79535-47bb-0310-9956-ffa450edef68 |
||
---|---|---|
.. | ||
AllProtocolTests.cpp | ||
AllProtocolTests.tcc | ||
Benchmark.cpp | ||
DebugProtoTest_extras.cpp | ||
DebugProtoTest.cpp | ||
DenseProtoTest.cpp | ||
GenericHelpers.h | ||
JSONProtoTest.cpp | ||
Makefile.am | ||
OptionalRequiredTest.cpp | ||
SpecializationTest.cpp | ||
TBufferBaseTest.cpp | ||
TFDTransportTest.cpp | ||
TFileTransportTest.cpp | ||
ThriftTest_extras.cpp | ||
TMemoryBufferTest.cpp | ||
TPipedTransportTest.cpp | ||
TransportTest.cpp | ||
UnitTestMain.cpp | ||
ZlibTest.cpp |