Re: g_timeout_add(0, ...)



On Fri, 2008-12-12 at 23:07 -0500, Tristan Van Berkom wrote:
> On Fri, Dec 12, 2008 at 2:46 PM,  <skip pobox com> wrote:
> >
> > Is it valid to call g_timeout_add with an interval of 0?  If so, does it
> > have well-defined semantics?  Might it recognize the 0ms interval and call
> > the handler immediately or will it guarantee that we at least return to the
> > main loop first?
> 
> I think what you want to use is g_idle_add().

The handler added by g_idle_add() would have a different execution
priority than you might want.

g_idle_add_full (G_PRIORITY_DEFAULT, ...);

Might be a closer equivalent to what the OP was wanting; some means to
get their callback called soon after the execution gets back to the
main-loop.

Regards,

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



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