Browse Source

*** empty log message ***

Marc Alexander Lehmann 13 years ago
3 changed files with 17 additions and 0 deletions
  1. +1
  2. +2
  3. +14

+ 1
- 0
Changes View File

@ -4,6 +4,7 @@ Revision history for libev, a high-performance and full-featured event loop.
- fix a 64 bit overflow issue in the select backend,
by using fd_mask instead of int for the mask.
- rename internal sighandler to avoid clash with very old perls.
- add ev_async_pending.
3.1 Thu Mar 13 13:45:22 CET 2008
- implement ev_async watchers.

+ 2
- 0
ev.h View File

@ -326,6 +326,8 @@ typedef struct ev_async
EV_ATOMIC_T sent; /* private */
} ev_async;
# define ev_async_pending(w) (((w)->sent + 0)
/* the presence of this union forces similar struct layout */

+ 14
- 0
ev.pod View File

@ -2290,6 +2290,20 @@ This call incurs the overhead of a syscall only once per loop iteration,
so while the overhead might be noticable, it doesn't apply to repeated
calls to C<ev_async_send>.
=item bool = ev_async_pending (ev_async *)
Returns a non-zero value when C<ev_async_send> has been called on the
watcher but the event has not yet been processed (or even noted) by the
event loop.
C<ev_async_send> sets a flag in the watcher and wakes up the loop. When
the loop iterates next and checks for the watcher to have become active,
it will reset the flag again. C<ev_async_pending> can be used to very
quickly check wether invoking the loop might be a good idea.
Not that this does I<not> check wether the watcher itself is pending, only
wether it has been requested to make this watcher pending.