race in RPCClient::waitResponse

This commit is contained in:
Michael Davidsaver
2017-07-05 13:45:59 +02:00
parent 13afc7f6c3
commit c1daf96456
+1 -3
View File
@@ -228,8 +228,6 @@ pvd::PVStructure::shared_pointer RPCClient::waitResponse(double timeout)
{
pvd::Lock L(m_rpc_requester->mutex);
TRACE("timeout="<<timeout);
if(!m_rpc_requester->inprogress)
throw std::logic_error("No request in progress");
while(m_rpc_requester->inprogress)
{
@@ -255,7 +253,7 @@ pvd::PVStructure::shared_pointer RPCClient::waitResponse(double timeout)
data.swap(m_rpc_requester->last_data);
if(!data)
throw std::logic_error("No reply data?!?");
throw std::logic_error("No request in progress");
// copy it so that the caller need not worry about whether it will overwritten
// when the next request is issued