Running g_main_loop_run() inside a applications while(1) function.
Mukesh Savaliya
Mukesh.Savaliya at MatrixComSec.com
Tue Aug 10 01:19:01 PDT 2010
No,Ikbel,
Actually , I have two separe process running on my board. They are
communicating though the dbus. Qt is performing GUI on Touch Screen
LCD attached to board. And main application is performing other task.
When ever events from GUI comes to the Main application by the callback
Function. I have to send message information to the GUI,which will be
Displayed on GUI by Qt.
Any way I have sorted out by running loop inside a GThread.
-----Original Message-----
From: Mohamed Ikbel Boulabiar [mailto:boulabiar at gmail.com]
Sent: Monday, August 09, 2010 2:25 PM
To: Mukesh Savaliya
Cc: dbus at lists.freedesktop.org
Subject: Re: Running g_main_loop_run() inside a applications while(1)
function.
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