Example #1
0
void rwmsg_destination_release(rwmsg_destination_t *dt) {
    RW_ASSERT_TYPE(dt, rwmsg_destination_t);
    bool zero=0;
    ck_pr_dec_32_zero(&dt->refct, &zero);
    if (zero) {
        rwmsg_garbage(&dt->ep->gc, RWMSG_OBJTYPE_DESTINATION, dt, NULL, NULL);
    }
}
Example #2
0
void rwmsg_method_release(rwmsg_endpoint_t *ep,
			  rwmsg_method_t *meth) {
  bool zero=0;
  ck_pr_dec_32_zero(&meth->refct, &zero);
  if (zero) {
    rwmsg_garbage(&ep->gc, RWMSG_OBJTYPE_METHOD, meth, NULL, NULL);
  }
}
Example #3
0
void
as_event_command_free(as_event_command* cmd)
{
    as_node_release(cmd->node);

    as_cluster* cluster = cmd->cluster;
    bool destroy;

    ck_pr_dec_32_zero(&cluster->async_pending, &destroy);

    // Only destroy cluster if cluster was closed and there are no pending async commands.
    if (destroy) {
        as_cluster_destroy(cluster);
    }

    if (cmd->free_buf) {
        cf_free(cmd->buf);
    }
    cf_free(cmd);
}