agoo_con_res_prepend(agooCon c, agooRes res) {
    pthread_mutex_lock(&c->res_lock);
    res->next = c->res_head;
    c->res_head = res;
    if (NULL == c->res_tail) {
	c->res_tail = res;
    }
    pthread_mutex_unlock(&c->res_lock);
}
agoo_con_res_prepend(agooCon c, agooRes res) {
    pthread_mutex_lock(&c->res_lock);
    res->next = c->res_head;
    c->res_head = res;
    if (NULL == c->res_tail) {
	c->res_tail = res;
    }
    pthread_mutex_unlock(&c->res_lock);
}