agoo_con_res_pop(agooCon c) {
    agooRes	res;

    pthread_mutex_lock(&c->res_lock);
    if (NULL != (res = c->res_head)) {
	c->res_head = res->next;
	if (res == c->res_tail) {
	    c->res_tail = NULL;
	}
    }
    pthread_mutex_unlock(&c->res_lock);

    return res;
}
agoo_con_res_pop(agooCon c) {
    agooRes	res;

    pthread_mutex_lock(&c->res_lock);
    if (NULL != (res = c->res_head)) {
	c->res_head = res->next;
	if (res == c->res_tail) {
	    c->res_tail = NULL;
	}
    }
    pthread_mutex_unlock(&c->res_lock);

    return res;
}