void libxl__poller_put(libxl_ctx *ctx, libxl__poller *p)
{
+ if (!p) return;
LIBXL_LIST_INSERT_HEAD(&ctx->pollers_idle, p, entry);
}
}
out:
- if (poller)
- libxl__poller_put(ctx, poller);
+ libxl__poller_put(ctx, poller);
CTX_UNLOCK;
EGC_FREE;
AO_GC;
if (!ao) return;
LOG(DEBUG,"ao %p: destroy",ao);
- if (ao->poller) libxl__poller_put(ctx, ao->poller);
+ libxl__poller_put(ctx, ao->poller);
ao->magic = LIBXL__AO_MAGIC_DESTROYED;
libxl__free_all(&ao->gc);
free(ao);
* away again afterwards. _get can fail, returning NULL.
* ctx must be locked. */
_hidden libxl__poller *libxl__poller_get(libxl_ctx *ctx);
-_hidden void libxl__poller_put(libxl_ctx *ctx, libxl__poller *p);
+_hidden void libxl__poller_put(libxl_ctx*, libxl__poller *p /* may be NULL */);
/* Notifies whoever is polling using p that they should wake up.
* ctx must be locked. */