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

references #247: split lock for input and output

parent 0a6cfeb8
......@@ -165,7 +165,8 @@ protected:
bool isGlobal_; // true if RoCE false otherwise
std::mutex lock_;
std::mutex olock_;
std::mutex ilock_;
public:
size_t asyncEventCounter_[MAX_ASYNC_EVENT]; // There are currently 19 defined async events
......
......@@ -18,7 +18,7 @@
// !!! Edit this line to reflect the latest package version !!!
#define CORE_PTVPI_VERSION_MAJOR 1
#define CORE_PTVPI_VERSION_MINOR 1
#define CORE_PTVPI_VERSION_MINOR 2
#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
......
......@@ -1366,7 +1366,7 @@ std::list<pt::vpi::LocalPipeInfo> pt::vpi::PeerTransport::getConnectedLocalPipes
{
pt::vpi::Application * app = dynamic_cast<pt::vpi::Application *>(this->getOwnerApplication());
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(olock_);
std::list<pt::vpi::LocalPipeInfo> tuples;
for ( auto o = opipes_.begin(); o != opipes_.end(); o++)
......@@ -1392,7 +1392,7 @@ std::list<pt::vpi::LocalPipeInfo> pt::vpi::PeerTransport::getAcceptedLocalPipes
{
pt::vpi::Application * app = dynamic_cast<pt::vpi::Application *>(this->getOwnerApplication());
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(ilock_);
std::list<pt::vpi::LocalPipeInfo> tuples;
for ( auto i = ipipes_.begin(); i != ipipes_.end(); i++)
......@@ -1418,7 +1418,7 @@ std::list<pt::vpi::LocalPipeInfo> pt::vpi::PeerTransport::getAcceptedLocalPipes
std::list<ibvla::QueuePair> pt::vpi::PeerTransport::getConnectedQueuePairs ()
{
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(olock_);
std::list<ibvla::QueuePair> connectedqps;
for ( auto o = opipes_.begin(); o != opipes_.end(); o++)
......@@ -1440,7 +1440,7 @@ std::list<ibvla::QueuePair> pt::vpi::PeerTransport::getConnectedQueuePairs ()
}
std::list<ibvla::QueuePair> pt::vpi::PeerTransport::getAcceptedQueuePairs ()
{
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(ilock_);
std::list<ibvla::QueuePair> connectedqps;
for ( auto i = ipipes_.begin(); i != ipipes_.end(); i++)
{
......@@ -1484,7 +1484,6 @@ void pt::vpi::PeerTransport::localconnect( size_t qpsize, size_t cqsize, const s
void pt::vpi::PeerTransport::connect(pt::Address::Reference from, pt::Address::Reference to, pt::pipe::ServiceListener * listener, std::shared_ptr<void> & user_context)
{
//std::lock_guard<std::mutex> guard(lock_);
pt::vpi::Application * app = dynamic_cast<pt::vpi::Application *>(this->getOwnerApplication());
......@@ -1557,7 +1556,7 @@ pt::pipe::Input * pt::vpi::PeerTransport::createInputPipe( std::shared_ptr<pt::
{
pt::vpi::Application * app = dynamic_cast<pt::vpi::Application *>(this->getOwnerApplication());
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(ilock_);
pt::vpi::ConnectionRequest * crp = dynamic_cast<pt::vpi::ConnectionRequest*>(cr.get());
......@@ -1586,7 +1585,7 @@ pt::pipe::Output * pt::vpi::PeerTransport::createOutputPipe( std::shared_ptr<pt
{
pt::vpi::Application * app = dynamic_cast<pt::vpi::Application *>(this->getOwnerApplication());
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(olock_);
pt::vpi::EstablishedConnection * ecp = dynamic_cast<pt::vpi::EstablishedConnection*>(ec.get());
//if ( ecp->isLocal())
......@@ -1614,7 +1613,7 @@ pt::pipe::Output * pt::vpi::PeerTransport::createOutputPipe( std::shared_ptr<pt:
{
//pt::vpi::Application * app = dynamic_cast<pt::vpi::Application *>(this->getOwnerApplication());
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(olock_);
pt::vpi::EstablishedConnection * ecp = dynamic_cast<pt::vpi::EstablishedConnection*>(ec.get());
//if ( ecp->isLocal())
......@@ -1641,7 +1640,7 @@ pt::pipe::Input * pt::vpi::PeerTransport::createInputPipe( std::shared_ptr<pt::
{
pt::vpi::Application * app = dynamic_cast<pt::vpi::Application *>(this->getOwnerApplication());
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(ilock_);
pt::vpi::ConnectionRequest * crp = dynamic_cast<pt::vpi::ConnectionRequest*>(cr.get());
......@@ -1667,7 +1666,7 @@ pt::pipe::Input * pt::vpi::PeerTransport::createInputPipe( std::shared_ptr<pt::
void pt::vpi::PeerTransport::destroyInputPipe(pt::pipe::Input * ip)
{
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(ilock_);
auto i = std::find(ipipes_.begin(), ipipes_.end(), ip);
if ( i != ipipes_.end() )
......@@ -1683,7 +1682,7 @@ void pt::vpi::PeerTransport::destroyInputPipe(pt::pipe::Input * ip)
void pt::vpi::PeerTransport::destroyOutputPipe(pt::pipe::Output * op)
{
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<std::mutex> guard(olock_);
auto o = std::find(opipes_.begin(), opipes_.end(), op);
if ( o != opipes_.end() )
......
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