add: lock_get( msg_lock ); cur_queued_size -= buf->len; cur_queued_units--; lock_release( msg_lock );
context: int get_from_queue(str *buf, struct peer **p){	struct queue_unit qu;	while (read( msg_pipe[0], &qu, sizeof(qu) )!=sizeof(qu) ) {		if (errno==EINTR)			continue;		LOG(L_ERR,"ERROR:put_in_queue: cannot read from pipe : %s\n",			strerror(errno));		return -1;	}	buf->s = qu.buf.s;	buf->len = qu.buf.len;	*p = qu.p;	return 1;}