}
void inline_speed
-ev_clear_pending (EV_P_ W w)
+clear_pending (EV_P_ W w)
{
if (w->pending)
{
}
}
+void
+ev_clear_pending (EV_P_ void *w, int invoke)
+{
+ W w_ = (W)w;
+ int pending = w_->pending;
+
+ if (pending)
+ {
+ ANPENDING *p = pendings [ABSPRI (w_)] + pending - 1;
+
+ w_->pending = 0;
+ p->w = 0;
+
+ if (invoke)
+ EV_CB_INVOKE (w_, p->events);
+ }
+}
+
void inline_size
pri_adjust (EV_P_ W w)
{
void
ev_io_stop (EV_P_ ev_io *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_timer_stop (EV_P_ ev_timer *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_periodic_stop (EV_P_ ev_periodic *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_signal_stop (EV_P_ ev_signal *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_child_stop (EV_P_ ev_child *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_stat_stop (EV_P_ ev_stat *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_idle_stop (EV_P_ ev_idle *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_prepare_stop (EV_P_ ev_prepare *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_check_stop (EV_P_ ev_check *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_embed_stop (EV_P_ ev_embed *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
void
ev_fork_stop (EV_P_ ev_fork *w)
{
- ev_clear_pending (EV_A_ (W)w);
+ clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
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
-C<ev_TYPE_set> is safe) and you must make sure the watcher is available to
-libev (e.g. you cnanot C<free ()> it).
+C<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 C<free ()>
+it).
=item callback ev_cb (ev_TYPE *watcher)
If you need to suppress invocation when higher priority events are pending
you need to look at C<ev_idle> watchers, which provide this functionality.
+You I<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 C<0>, which is supposed to not be too high and not be too low :).