THRIFT-926. cpp: Fix bugs in TFileTransport::flush()
authorDavid Reiss <dreiss@apache.org>
Wed, 6 Oct 2010 17:10:33 +0000 (17:10 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 6 Oct 2010 17:10:33 +0000 (17:10 +0000)
commit4f9efdb460a7c54cc55b25f2c6b8955a5fcff229
tree0c31542a9e504f19b089d4dd27660bedc8ea70f8
parent4199377a7c5dbb72679abe9c05c9663e3736a780
THRIFT-926. cpp: Fix bugs in TFileTransport::flush()

Previously flush() had race conditions that could cause it to return
before all data had actually been flushed to disk.  Now the writer
makes sure both buffer queues have been flushed when forceFlush_ is set.

Also, flush() did not wake up the writer thread, so it normally had to
wait for the writer thread to wake up on its own time.  (By default,
this could take up to 3 seconds.)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005156 13f79535-47bb-0310-9956-ffa450edef68
lib/cpp/src/transport/TFileTransport.cpp
lib/cpp/src/transport/TFileTransport.h
lib/cpp/test/TFileTransportTest.cpp
lib/cpp/test/TransportTest.cpp