queue.take possible race, send thread does not wait for read anymore

This commit is contained in:
Matej Sekoranja
2015-01-07 12:58:28 +01:00
parent ffeab62d7f
commit 228d7fe279
3 changed files with 17 additions and 4 deletions

View File

@@ -1214,7 +1214,7 @@ namespace epics {
void BlockingAbstractCodec::sendThread(void *param)
{
BlockingAbstractCodec *bac = static_cast<BlockingAbstractCodec *>(param);
BlockingAbstractCodec *bac = static_cast<BlockingAbstractCodec *>(param);
Transport::shared_pointer ptr = bac->shared_from_this();
bac->setSenderThread();
@@ -1241,16 +1241,17 @@ namespace epics {
}
}
/*
// wait read thread to die
// TODO rewise
// TODO rewise if this is really needed
// this timeout is needed where close() is initiated from the send thread,
// and not from the read thread as usualy - recv() does not exit until socket is not destroyed,
// which is done the internalDestroy() call below
bac->_shutdownEvent.wait(3.0);
*/
// call internal destroy
bac->internalDestroy();
}