--- libev/ev.html 2007/12/07 20:19:16 1.69 +++ libev/ev.html 2007/12/08 14:27:39 1.70 @@ -6,7 +6,7 @@ - + @@ -771,8 +771,9 @@

Returns a true value iff the watcher is pending, (i.e. it has outstanding events but its callback has not yet been invoked). As long as a watcher is pending (but not active) you must not call an init function on it (but -ev_TYPE_set is safe) and you must make sure the watcher is available to -libev (e.g. you cnanot free () it).

+ev_TYPE_set is safe), you must not change its priority, and you must +make sure the watcher is available to libev (e.g. you cannot free () +it).

callback ev_cb (ev_TYPE *watcher)
@@ -797,12 +798,26 @@ watchers on the same event and make sure one is called first.

If you need to suppress invocation when higher priority events are pending you need to look at ev_idle watchers, which provide this functionality.

+

You must not change the priority of a watcher as long as it is active or +pending.

The default priority used by watchers when no priority has been set is always 0, which is supposed to not be too high and not be too low :).

Setting a priority outside the range of EV_MINPRI to EV_MAXPRI is fine, as long as you do not mind that the priority value you query might or might not have been adjusted to be within valid range.

+
ev_invoke (loop, ev_TYPE *watcher, int revents)
+
+

Invoke the watcher with the given loop and revents. Neither +loop nor revents need to be valid as long as the watcher callback +can deal with that fact.

+
+
int ev_clear_pending (loop, ev_TYPE *watcher)
+
+

If the watcher is pending, this function returns clears its pending status +and returns its revents bitset (as if its callback was invoked). If the +watcher isn't pending it does nothing and returns 0.

+
@@ -1808,12 +1823,18 @@ -
w->set (void (*function)(watcher &w, int), void *data = 0)
+
w->set<function> (void *data = 0)

Also sets a callback, but uses a static method or plain function as callback. The optional data argument will be stored in the watcher's data member and is free for you to use.

+

The prototype of the function must be void (*)(ev::TYPE &w, int).

See the method-set above for more details.

+

Example:

+
  static void io_cb (ev::io &w, int revents) { }
+  iow.set <io_cb> ();
+
+
w->set (struct ev_loop *)