Fixed ORBit-2.7.x+ lockup by ORB "orbit-local-non-threaded-orb" declaration.
authorshort <>
Wed, 5 Nov 2003 21:57:01 +0000 (21:57 +0000)
committershort <>
Wed, 5 Nov 2003 21:57:01 +0000 (21:57 +0000)
 - libcaptive is single-threaded already.

src/client/sandbox-server/main.c
src/libcaptive/sandbox/split.c

index 4ade0fa..ff77349 100644 (file)
@@ -496,7 +496,13 @@ gchar *orb_argv[]={
                NULL};
 
                        CORBA_exception_init(&ev);
-                       orb=CORBA_ORB_init(&orb_argc,orb_argv,"orbit-local-orb",&ev);
+                       /* libcaptive is single-threaded only, caller must lock it.
+                        * If thread A spawned the sandbox while currently doing its own work
+                        * and thread B calls the sandbox thread B waits on ORB_run()
+                        * while the sandbox waits for the response of thread A ORB. Deadlock.
+                        * "orbit-local-non-threaded-orb" requests thread unaware ORB.
+                        */
+                       orb=CORBA_ORB_init(&orb_argc,orb_argv,"orbit-local-non-threaded-orb",&ev);
                        if (orb==CORBA_OBJECT_NIL)
                                fatal("Cannot initialize CORBA ORB (CORBA_OBJECT_NIL): %m");
                        if (ev._major!=CORBA_NO_EXCEPTION)
index 9af2f3a..f9da17a 100644 (file)
@@ -87,7 +87,13 @@ gchar *orb_argv[]={
        CORBA_exception_init(evp);
 
        /* Init 'orb' */
-       *orbp=CORBA_ORB_init(&orb_argc,orb_argv,"orbit-local-orb",evp);
+       /* libcaptive is single-threaded only, caller must lock it.
+        * If thread A spawned the sandbox while currently doing its own work
+        * and thread B calls the sandbox thread B waits on ORB_run()
+        * while the sandbox waits for the response of thread A ORB. Deadlock.
+        * "orbit-local-non-threaded-orb" requests thread unaware ORB.
+        */
+       *orbp=CORBA_ORB_init(&orb_argc,orb_argv,"orbit-local-non-threaded-orb",evp);
        g_return_val_if_fail(*orbp!=CORBA_OBJECT_NIL,FALSE);
        g_return_val_if_fail(validate_CORBA_Environment(evp),FALSE);