Running g_main_loop_run() inside a applications while(1) function.

Mohamed Ikbel Boulabiar boulabiar at gmail.com
Mon Aug 9 01:54:53 PDT 2010


Hi,

First of all, why are you mixing Qt code with dbus-glib code ?
I think Qt has classes for dealing with DBus.

g_main_loop_run() is run once, and it's the main loop (like app.exec()
in Qt) so you shouldn't run it inside another loop.

To do the main work, you should add you code inside that loop (attach
your code to it)



On Mon, Aug 9, 2010 at 10:41 AM, Mukesh Savaliya
<Mukesh.Savaliya at matrixcomsec.com> wrote:
> Hello dbus,
>
>
>
>    I am entered into a trouble. My application cant run g_main_loop_run()
> inside a while(1) function, which is polling  other functionality.
>
>
>
> Can some one please tell me, how can I run g_main_loop_run() inside a
> while(1){ } function of applications main() function. It gets blocked when
>
> It reaches to g_main_loop_run(). Actually I am calling other functions
> inside while(1). I do also need to tackle the Qt applications events,which I
> do
>
> Write in a Queue. So I am also polling this queue.
>
>
>
>  So,here I can either read the queue(in this case Qt events/signals are not
> getting handled with dbus-glib application),or only write the events in
> queue.
>
> (in this case is must run inside g_main_loop() to get the events,so
> while(1?) cant be run).
>
>
>
>
>
> Please reply me ASAP.
>
>
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
>


More information about the dbus mailing list