Commit a8b6ecab authored by Luciano Orsini's avatar Luciano Orsini
Browse files

references #253: reduced scope for mutex

parent aece2144
......@@ -18,7 +18,7 @@
// !!! Edit this line to reflect the latest package version !!!
#define CORE_PTVPI_VERSION_MAJOR 1
#define CORE_PTVPI_VERSION_MINOR 5
#define CORE_PTVPI_VERSION_MINOR 6
#define CORE_PTVPI_VERSION_PATCH 0
// If any previous versions available E.g. #define CORE_PTVPI_PREVIOUS_VERSIONS "3.8.0,3.8.1"
#undef CORE_PTVPI_PREVIOUS_VERSIONS
......
......@@ -1517,7 +1517,6 @@ pt::pipe::Output * pt::vpi::PeerTransport::createOutputPipe( std::shared_ptr<pt
pt::pipe::Output * pt::vpi::PeerTransport::createOutputPipe( std::shared_ptr<pt::pipe::EstablishedConnection> & ec, pt::pipe::OutputListener * listener , size_t n)
{
std::lock_guard<std::mutex> guard(olock_);
pt::vpi::EstablishedConnection * ecp = dynamic_cast<pt::vpi::EstablishedConnection*>(ec.get());
//if ( ecp->isLocal())
......@@ -1527,6 +1526,8 @@ pt::pipe::Output * pt::vpi::PeerTransport::createOutputPipe( std::shared_ptr<pt:
LOG4CPLUS_DEBUG(this->getOwnerApplication()->getApplicationLogger(), "Create local output pipe");
pt::vpi::Output * opipe = new pt::vpi::LOutput (ec, listener, this);
std::lock_guard<std::mutex> guard(olock_);
opipes_.push_back(opipe);
return opipe;
}
......@@ -1535,6 +1536,8 @@ pt::pipe::Output * pt::vpi::PeerTransport::createOutputPipe( std::shared_ptr<pt:
LOG4CPLUS_DEBUG(this->getOwnerApplication()->getApplicationLogger(), "Create remote output pipe");
pt::vpi::Output * opipe = new pt::vpi::ROutput (ec, listener, this, n);
std::lock_guard<std::mutex> guard(olock_);
opipes_.push_back(opipe);
return opipe;
}
......@@ -1543,7 +1546,7 @@ pt::pipe::Output * pt::vpi::PeerTransport::createOutputPipe( std::shared_ptr<pt:
pt::pipe::Input * pt::vpi::PeerTransport::createInputPipe( std::shared_ptr<pt::pipe::ConnectionRequest> & cr , pt::pipe::InputListener * listener, size_t n)
{
std::lock_guard<std::mutex> guard(ilock_);
pt::vpi::ConnectionRequest * crp = dynamic_cast<pt::vpi::ConnectionRequest*>(cr.get());
......@@ -1553,6 +1556,8 @@ pt::pipe::Input * pt::vpi::PeerTransport::createInputPipe( std::shared_ptr<pt::
LOG4CPLUS_DEBUG(this->getOwnerApplication()->getApplicationLogger(), "Create local input pipe for network :" << cr->getNetwork());
pt::vpi::Input * ipipe = new pt::vpi::LInput (cr, listener, this);
std::lock_guard<std::mutex> guard(ilock_);
ipipes_.push_back(ipipe);
return ipipe;
}
......@@ -1561,6 +1566,8 @@ pt::pipe::Input * pt::vpi::PeerTransport::createInputPipe( std::shared_ptr<pt::
LOG4CPLUS_DEBUG(this->getOwnerApplication()->getApplicationLogger(), "Create remote input pipe for network :" << cr->getNetwork());
pt::vpi::Input * ipipe = new pt::vpi::RInput (cr, listener, this, n);
std::lock_guard<std::mutex> guard(ilock_);
ipipes_.push_back(ipipe);
return ipipe;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment