Hi,

Forgot to attach the patch to my last email ;)

regards,
Arne Pajunen
--- mico2.3.12\orb\iop.cc       Wed Aug 16 16:07:34 2006
+++ mico-new\orb\iop.cc Wed Aug 16 16:12:22 2006
@@ -2145,7 +2145,7 @@
        MICO::Logger::Stream(MICO::Logger::GIOP)
            << "MICO::GIOPConnReader::_run()" << endl;
     }
-    GIOPConn::set_as_reader_thread();
+    conn->set_as_reader_thread();
     if (MICO::MTManager::threaded_client() && conn->side() == CLIENT_SIDE) {
         // client side using threaded client
         while (conn->state() == MICOMT::StateRefCnt::Active) {
@@ -2342,7 +2342,7 @@
 MICO::GIOPConn::is_this_reader_thread()
 {
     assert(S_reader_key_initialized_);
-    if (MICOMT::Thread::get_specific(S_reader_key_) != NULL) {
+    if (MICOMT::Thread::get_specific(S_reader_key_) == (void*)this) {
         return TRUE;
     }
     return FALSE;
@@ -2355,7 +2355,10 @@
     // kcg: this is a trick: reuse bool value
     // for key setup with known storage and omit a need
     // for key value cleanup function
-    MICOMT::Thread::set_specific(S_reader_key_, &S_reader_key_initialized_);
+    // ap: changed from using &S_reader_key_initilized_
+    // to make it possible to identify which connections
+    // reader thread this is.
+    MICOMT::Thread::set_specific(S_reader_key_, (void*)this);
 }
 
 void
--- mico2.3.12\orb\orb.cc       Mon Jul 31 12:40:12 2006
+++ mico-new\orb\orb.cc Wed Aug 16 15:57:34 2006
@@ -2724,10 +2724,22 @@
     //FIXME: this is still not right - but OK for the moment
     //       we have to behave the old way, when the ORB thread calls us !!!
 #ifdef HAVE_THREADS
+    MICO::IIOPProxyInvokeRec* proxy_invoke_rec = NULL;
+       MICO::GIOPConn *invoke_rec_conn = NULL;
+       CORBA::Boolean is_conn_reader_thread = FALSE;
+
+    if (rec != NULL) {
+        proxy_invoke_rec = (MICO::IIOPProxyInvokeRec*)rec->get_invoke_hint();
+       
+               if (proxy_invoke_rec != NULL) {
+                       invoke_rec_conn = proxy_invoke_rec->conn();
+               }
+    }
+
     if (rec
         && (MICO::MTManager::blocking_threaded_client()
             || (MICO::MTManager::threaded_client()
-                && !MICO::GIOPConn::is_this_reader_thread()))) {
+                && !((invoke_rec_conn != NULL) && 
invoke_rec_conn->is_this_reader_thread()) ))) {
         // kcg: either blocking_threaded or threaded client concurrency
         // model is in use, in case of threaded, we're invoking wait
         // from one of client's thread instead of connection reader thread
@@ -2740,7 +2752,7 @@
     else if (rec
              && (MICO::MTManager::reactive_client()
                  || (MICO::MTManager::threaded_client()
-                     && MICO::GIOPConn::is_this_reader_thread()))) {
+                     && ((invoke_rec_conn != NULL) && 
invoke_rec_conn->is_this_reader_thread()) ))) {
         // kcg: either reactive or threaded client concurrency model
         // is used. In case of threaded, we're invoking wait from reader
         // thread, hence we can not block on waitfor above but rather wait
@@ -2755,11 +2767,8 @@
 
 #ifdef HAVE_THREADS
     Dispatcher* disp_for_waiting = NULL;
-    MICO::IIOPProxyInvokeRec* proxy_invoke_rec = NULL;
-    if (rec != NULL) {
-        proxy_invoke_rec = (MICO::IIOPProxyInvokeRec*)rec->get_invoke_hint();
-    }
-    if (proxy_invoke_rec != NULL)
+
+       if (proxy_invoke_rec != NULL)
         disp_for_waiting = proxy_invoke_rec->conn()->dispatcher();
     else
         disp_for_waiting = this->_disp;
--- mico2.3.12\include\mico\iop.h       Fri Nov 25 12:15:52 2005
+++ mico-new\include\mico\iop.h Wed Aug 16 15:37:09 2006
@@ -459,10 +459,10 @@
     active_deref();
 
     // three methods using TLS for `detecting' reader thread
-    static CORBA::Boolean
+    CORBA::Boolean
     is_this_reader_thread();
 
-    static void
+    void
     set_as_reader_thread();
 
     static void
_______________________________________________
Mico-devel mailing list
[email protected]
http://www.mico.org/mailman/listinfo/mico-devel

Reply via email to