thrift/lib/cpp/test
David Reiss 709b69f14c THRIFT-926. cpp: Fix destructor behavior of TFileTransport
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
2010-10-06 17:10:30 +00:00
..
AllProtocolTests.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
AllProtocolTests.tcc THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
Benchmark.cpp THRIFT-922. cpp: Templatize binary and compact protocol 2010-10-06 17:09:56 +00:00
DebugProtoTest_extras.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
DebugProtoTest.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
DenseProtoTest.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
GenericHelpers.h THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
JSONProtoTest.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
Makefile.am THRIFT-926. cpp: Fix destructor behavior of TFileTransport 2010-10-06 17:10:30 +00:00
OptionalRequiredTest.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
SpecializationTest.cpp THRIFT-922. cpp: Templatize binary and compact protocol 2010-10-06 17:09:56 +00:00
TBufferBaseTest.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
TFDTransportTest.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
TFileTransportTest.cpp THRIFT-926. cpp: Fix destructor behavior of TFileTransport 2010-10-06 17:10:30 +00:00
ThriftTest_extras.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
TMemoryBufferTest.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
TPipedTransportTest.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
TransportTest.cpp THRIFT-926. cpp: remove "standalone" distinction in TZlibTransport 2010-10-06 17:10:27 +00:00
UnitTestMain.cpp THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp 2010-08-31 16:51:19 +00:00
ZlibTest.cpp THRIFT-926. cpp: remove "standalone" distinction in TZlibTransport 2010-10-06 17:10:27 +00:00