Regd ev_timer

Varun Chandramohan cvaruneng04 at gmail.com
Wed Apr 3 02:56:09 CEST 2013


Thanks Marc, that seem clear. Would you be able to answer the question I
asked Jann about the timer.

I have pasted my code in previous post that can be compiled directly. It
works now but if I just remove  ev_now_update(loop) from both my handlers
then the code goes bad and
I get timeout events even though the timer is stopped. Do you know why this
is happening? Even though my problem is solved I want to understand the
reason behind the issue.

Regards,
Varun


On Wed, Apr 3, 2013 at 11:33 AM, Marc Lehmann <schmorp at schmorp.de> wrote:

> On Wed, Apr 03, 2013 at 09:54:46AM +1100, Varun Chandramohan <
> cvaruneng04 at gmail.com> wrote:
> > question, so at line 78 if I removed if (events & EV_TIMEOUT) { }
> > check will it be an issue. I dont see anything else calling this call
> back
> > apart from this event. May be EV_ERROR perhaps?
>
> The revents should only contain the bit flag for the event you asked for,
> and
> EV_ERROR, at least from libevs side (you can feed other events manually, or
> combine masks).
>
> Now, regardless of receiving an error, you can always stop a watcher that
> has been initialised, whether libev knows about it or not, so calling stop
> functions is safe.
>
> In addition, EV_ERROR usually means a programming error, so you never need
> to check for it in a correctly wirtten program :) You can just assume that
> a timer will always get an EV_TIMEOUT revents.
>
> > Will you be able to tell me theoretically what was going on? I still not
> > aware of what exactly went wrong. Also I have been
> > using this manual http://doc.dvgu.ru/devel/ev.html for development. I
> could
>
> For some reason, that russian site is very popular, but has a completely
> outdated libev library and documentation. However, the antique libev
> version on that side at least should match the documentation.
>
> The documentation, incidentally, links to the most up-to-date version of
> the docs in the DESCRIPTION:
> http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod
>
> --
>                 The choice of a       Deliantra, the free code+content
> MORPG
>       -----==-     _GNU_              http://www.deliantra.net
>       ----==-- _       generation
>       ---==---(_)__  __ ____  __      Marc Lehmann
>       --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
>       -=====/_/_//_/\_,_/ /_/\_\
>
> _______________________________________________
> libev mailing list
> libev at lists.schmorp.de
> http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20130403/5d3078a3/attachment.html>


More information about the libev mailing list