summaryrefslogtreecommitdiff
path: root/TAO/tao/Strategies
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2017-01-03 15:36:54 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2017-01-03 15:36:54 +0100
commit6f66470f609a4aba63f95e637261859892bce458 (patch)
treeacc9ad8eab80442afbee64e4acb0f362d00430f6 /TAO/tao/Strategies
parent02052a420dea4dafaa7134e02653aa42a63d41fc (diff)
downloadATCD-6f66470f609a4aba63f95e637261859892bce458.tar.gz
The successful/error_detected/keep_waiting accessors of TAO_LF_Event are also called from outside of the leader follower loop by other threads. This could trigger a data race because an inconsistent state is ready. Moved the real logic to _i methods and the public accessors now first lock the lf lock, this is normally only done in connection setup so doesn't add a penalty to the regular invocation path
* TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp: * TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp: * TAO/tao/IIOP_Connector.cpp: * TAO/tao/LF_CH_Event.cpp: * TAO/tao/LF_CH_Event.h: * TAO/tao/LF_Connect_Strategy.cpp: * TAO/tao/LF_Event.cpp: * TAO/tao/LF_Event.h: * TAO/tao/LF_Event.inl: * TAO/tao/LF_Invocation_Event.cpp: * TAO/tao/LF_Invocation_Event.h: * TAO/tao/LF_Multi_Event.cpp: * TAO/tao/LF_Multi_Event.h: * TAO/tao/Leader_Follower.cpp: * TAO/tao/Reactive_Connect_Strategy.cpp: * TAO/tao/Strategies/SCIOP_Connector.cpp: * TAO/tao/Strategies/SHMIOP_Connector.cpp: * TAO/tao/Strategies/UIOP_Connector.cpp: * TAO/tao/Transport_Connector.cpp: * TAO/tao/Wait_On_Reactor.cpp: * TAO/tao/Wait_On_Read.cpp: * TAO/tests/Bug_3531b_Regression/server.cpp:
Diffstat (limited to 'TAO/tao/Strategies')
-rw-r--r--TAO/tao/Strategies/SCIOP_Connector.cpp9
-rw-r--r--TAO/tao/Strategies/SHMIOP_Connector.cpp11
-rw-r--r--TAO/tao/Strategies/UIOP_Connector.cpp8
3 files changed, 17 insertions, 11 deletions
diff --git a/TAO/tao/Strategies/SCIOP_Connector.cpp b/TAO/tao/Strategies/SCIOP_Connector.cpp
index 3f88e558447..c263df359af 100644
--- a/TAO/tao/Strategies/SCIOP_Connector.cpp
+++ b/TAO/tao/Strategies/SCIOP_Connector.cpp
@@ -236,12 +236,15 @@ TAO_SCIOP_Connector::make_connection_i (TAO::Profile_Transport_Resolver *r,
return 0;
}
- if (svc_handler->keep_waiting ())
+ TAO_Leader_Follower &leader_follower = this->orb_core ()->leader_follower ();
+
+
+ if (svc_handler->keep_waiting (leader_follower))
{
svc_handler->connection_pending ();
}
- if (svc_handler->error_detected ())
+ if (svc_handler->error_detected (leader_follower))
{
svc_handler->cancel_pending_connection ();
return 0;
@@ -278,7 +281,7 @@ TAO_SCIOP_Connector::make_connection_i (TAO::Profile_Transport_Resolver *r,
return 0;
}
- if (svc_handler->error_detected ())
+ if (svc_handler->error_detected (leader_follower)
{
svc_handler->cancel_pending_connection ();
transport->purge_entry();
diff --git a/TAO/tao/Strategies/SHMIOP_Connector.cpp b/TAO/tao/Strategies/SHMIOP_Connector.cpp
index 2f5e4e426be..bcf909b54ee 100644
--- a/TAO/tao/Strategies/SHMIOP_Connector.cpp
+++ b/TAO/tao/Strategies/SHMIOP_Connector.cpp
@@ -173,18 +173,19 @@ TAO_SHMIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *,
return 0;
}
- if (svc_handler->keep_waiting ())
+ TAO_Leader_Follower &leader_follower = this->orb_core ()->leader_follower ();
+
+ if (svc_handler->keep_waiting (leader_follower))
{
svc_handler->connection_pending ();
}
- if (svc_handler->error_detected ())
+ if (svc_handler->error_detected (leader_follower))
{
svc_handler->cancel_pending_connection ();
}
- TAO_Transport *transport =
- svc_handler->transport ();
+ TAO_Transport *transport = svc_handler->transport ();
// At this point, the connection has be successfully connected.
// #REFCOUNT# is one.
@@ -218,7 +219,7 @@ TAO_SHMIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *,
return 0;
}
- if (svc_handler->error_detected ())
+ if (svc_handler->error_detected (leader_follower))
{
svc_handler->cancel_pending_connection ();
transport->purge_entry();
diff --git a/TAO/tao/Strategies/UIOP_Connector.cpp b/TAO/tao/Strategies/UIOP_Connector.cpp
index 3b9e56f6067..1d739ccd8c8 100644
--- a/TAO/tao/Strategies/UIOP_Connector.cpp
+++ b/TAO/tao/Strategies/UIOP_Connector.cpp
@@ -210,12 +210,14 @@ TAO_UIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *r,
return 0;
}
- if (svc_handler->keep_waiting ())
+ TAO_Leader_Follower &leader_follower = this->orb_core ()->leader_follower ();
+
+ if (svc_handler->keep_waiting (leader_follower))
{
svc_handler->connection_pending ();
}
- if (svc_handler->error_detected ())
+ if (svc_handler->error_detected (leader_follower))
{
svc_handler->cancel_pending_connection ();
}
@@ -250,7 +252,7 @@ TAO_UIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *r,
return 0;
}
- if (svc_handler->error_detected ())
+ if (svc_handler->error_detected (leader_follower))
{
svc_handler->cancel_pending_connection ();
transport->purge_entry();