Re: graceful mulit-threaded shutdown



Hi,

On Fri, 07 Nov 2003 23:12:33 +0100, Tyler Kohn wrote:
...
> When my app shuts down, a child thread goes through all of my loaded
> components and has them shut themselves down gracefully.  My orbit2 server
> is a child of one of these components.  The problem is that the thread that
> started the server is blocking and when I try to shutdown the server from
> another thread I get:
> 
> ** ERROR **: Must shutdown ORB from main thread
> aborting...

I think the solution from Michael Meeks should apply even to you:


On Wed, 05 Nov 2003 13:08:02 +0100, Michael Meeks wrote:
...
> replace all calls to CORBA_ORB_run with something like:
>
>       ctxt = g_main_context_default ();
>       loop = g_main_loop_new (ctxt, TRUE);
>       g_main_loop_run (loop);

While you can use
	g_main_loop_quit(loop);

from 'another thread' (initiating the framework shutdown) and finally:

^	ctxt = g_main_context_default ();
^	loop = g_main_loop_new (ctxt, TRUE);
^	g_main_loop_run (loop);
->	CORBA_ORB_destroy (...);



Regards,
Lace

-- 
Jan Kratochvil; Captive: free r/w NTFS Filesystem; http://www.jankratochvil.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]