1 diff -ur ORBit2-2.14.18-old/include/orbit/GIOP/giop.h ORBit2-2.14.18-new/include/orbit/GIOP/giop.h
2 --- ORBit2-2.14.18-old/include/orbit/GIOP/giop.h 2009-04-18 20:20:54.000000000 +0800
3 +++ ORBit2-2.14.18-new/include/orbit/GIOP/giop.h 2010-05-28 14:35:56.012926304 +0800
6 #ifdef ORBIT2_INTERNAL_API
8 +void giop_set_main_context (GMainContext *context);
9 void giop_init (gboolean thread_safe,
10 gboolean blank_wire_data);
11 void giop_main_run (void);
12 diff -ur ORBit2-2.14.18-old/include/orbit/orb-core/corba-orb.h ORBit2-2.14.18-new/include/orbit/orb-core/corba-orb.h
13 --- ORBit2-2.14.18-old/include/orbit/orb-core/corba-orb.h 2009-04-18 20:20:54.000000000 +0800
14 +++ ORBit2-2.14.18-new/include/orbit/orb-core/corba-orb.h 2010-05-28 14:36:31.612946110 +0800
17 glong ORBit_get_giop_recv_limit (void);
19 +void ORBit_set_giop_main_context (GMainContext *context);
21 #ifdef ORBIT2_INTERNAL_API
23 void ORBit_ORB_forw_bind (CORBA_ORB orb,
24 diff -ur ORBit2-2.14.18-old/src/orb/GIOP/giop.c ORBit2-2.14.18-new/src/orb/GIOP/giop.c
25 --- ORBit2-2.14.18-old/src/orb/GIOP/giop.c 2009-04-18 20:20:54.000000000 +0800
26 +++ ORBit2-2.14.18-new/src/orb/GIOP/giop.c 2010-05-28 14:34:39.517566265 +0800
28 static int corba_wakeup_fds[2];
29 #define WAKEUP_POLL corba_wakeup_fds [0]
30 #define WAKEUP_WRITE corba_wakeup_fds [1]
31 +static GMainContext *giop_main_context = NULL;
32 static GSource *giop_main_source = NULL;
33 static GIOPThread *giop_main_thread = NULL;
39 +giop_set_main_context (GMainContext *context)
41 + giop_main_context = context;
45 giop_init (gboolean thread_safe, gboolean blank_wire_data)
47 link_init (thread_safe);
49 if (giop_thread_safe ()) {
51 + if (!giop_main_context)
52 + giop_main_context = g_main_context_default();
54 /* We need a destructor to clean up if giopthreads are used
55 * outside of ORBit controlled threads */
56 giop_tdata_private = g_private_new ((GDestroyNotify)giop_thread_free);
58 - giop_main_thread = tdata = giop_thread_new (
59 - g_main_context_default ()); /* main thread */
60 + giop_main_thread = tdata = giop_thread_new (giop_main_context); /* main thread */
62 if (link_pipe (corba_wakeup_fds) < 0) /* cf. g_main_context_init_pipe */
63 g_error ("Can't create CORBA main-thread wakeup pipe");
65 fcntl (WAKEUP_WRITE, F_SETFL, O_NONBLOCK);
67 giop_main_source = link_source_create_watch (
68 - g_main_context_default (), WAKEUP_POLL,
69 + giop_main_context, WAKEUP_POLL,
70 NULL, (G_IO_IN | G_IO_PRI),
71 giop_mainloop_handle_input, NULL);
73 diff -ur ORBit2-2.14.18-old/src/orb/orb-core/corba-orb.c ORBit2-2.14.18-new/src/orb/orb-core/corba-orb.c
74 --- ORBit2-2.14.18-old/src/orb/orb-core/corba-orb.c 2009-04-18 20:20:54.000000000 +0800
75 +++ ORBit2-2.14.18-new/src/orb/orb-core/corba-orb.c 2010-05-28 14:35:25.821387536 +0800
76 @@ -1442,6 +1442,12 @@
77 return giop_recv_get_limit ();
81 +ORBit_set_giop_main_context (GMainContext *context)
83 + giop_set_main_context (context);
86 const ORBit_option orbit_supported_options[] = {
87 { "ORBid", ORBIT_OPTION_STRING, NULL }, /* FIXME: unimplemented */
88 { "ORBImplRepoIOR", ORBIT_OPTION_STRING, NULL }, /* FIXME: unimplemented */