--- libev/ev.pod 2011/12/20 04:08:35 1.388 +++ libev/ev.pod 2012/01/24 16:38:55 1.395 @@ -1880,7 +1880,7 @@ else { // callback was invoked, but there was some recent - // activity. simply restart the timer to time out + // activity. simply restart the timer to time out // after "after" seconds, which is the earliest time // the timeout can occur. ev_timer_set (w, after, 0.); @@ -2110,15 +2110,24 @@ =item ev_timer_again (loop, ev_timer *) -This will act as if the timer timed out and restarts it again if it is -repeating. The exact semantics are: +This will act as if the timer timed out, and restarts it again if it is +repeating. It basically works like calling C, updating the +timeout to the C value and calling C. -If the timer is pending, its pending status is cleared. +The exact semantics are as in the following rules, all of which will be +applied to the watcher: -If the timer is started but non-repeating, stop it (as if it timed out). +=over 4 + +=item If the timer is pending, the pending status is always cleared. + +=item If the timer is started but non-repeating, stop it (as if it timed +out, without invoking it). -If the timer is repeating, either start it if necessary (with the -C value), or reset the running timer to the C value. +=item If the timer is repeating, make the C value the new timeout +and start the timer, if necessary. + +=back This sounds a bit complicated, see L, above, for a usage example. @@ -3635,7 +3644,7 @@ while (!exit_main_loop) ev_run (EV_DEFAULT_ EVRUN_ONCE); - // in a model watcher + // in a modal watcher int exit_nested_loop = 0; while (!exit_nested_loop) @@ -3825,7 +3834,7 @@ That basically suspends the coroutine inside C and continues the libev coroutine, which, when appropriate, switches back to -this or any other coroutine. I am sure if you sue this your own :) +this or any other coroutine. You can do similar tricks if you have, say, threads with an event queue - instead of storing a coroutine, you store the queue object and instead of @@ -3928,7 +3937,7 @@ For each C watcher in F there is a corresponding class of the same name in the C namespace, with the exception of C which is called C to avoid clashes with the C macro -defines by many implementations. +defined by many implementations. All of those classes have these methods: @@ -4665,6 +4674,9 @@ To use this, define C and include F in the file that wants to use libev. +This option only works when libev is compiled with a C compiler, as C++ +doesn't support the required declaration syntax. + =item EV_AVOID_STDIO If this is set to C<1> at compiletime, then libev will avoid using stdio