gochatai/pachi_py/pachi/distributed/protocol.c
/* Insert a buffer in the receive queue. It should be the most
 * recent buffer allocated by the calling thread.
 * slave_lock is held on both entry and exit of this function. */
Insert a buffer in the receive queue. It should be the most
recent buffer allocated by the calling thread.
slave_lock is held on both entry and exit of this function.
Insert a buffer in the receive queue . It should be the most recent buffer allocated by the calling thread . slave_lock is held on both entry and exit of this function .
static void
insert_buf(struct slave_state *sstate, void *buf, int size)
{
	assert(queue_length < queue_max_length);
	int newest = sstate->newest_buf;
	assert(buf == sstate->b[newest].buf);
	if (sstate->insert_hook) sstate->insert_hook(buf, size);
	if (DEBUGVV(7)) {
		char b[1024];
		snprintf(b, sizeof(b),
			 "insert newest %d age %d rq[%d]->%p owner %d\n",
			 newest, queue_age, queue_length, buf, sstate->thread_id);
			logline(&sstate->client, "? ", b);
	}
	receive_queue[queue_length] = &sstate->b[newest];
	receive_queue[queue_length]->size = size;
	receive_queue[queue_length]->queue_index = queue_length;
	queue_length++;
}
static void insert_buf ( struct slave_state * sstate , void * buf , int size ) { assert ( queue_length < queue_max_length ) ; int newest = sstate -> newest_buf ; assert ( buf == sstate -> b [ newest ] . buf ) ; if ( sstate -> insert_hook ) sstate -> insert_hook ( buf , size ) ; if ( DEBUGVV ( 7 ) ) { char b [ 1024 ] ; snprintf ( b , sizeof ( b ) , " \n " , newest , queue_age , queue_length , buf , sstate -> thread_id ) ; logline ( & sstate -> client , " " , b ) ; } receive_queue [ queue_length ] = & sstate -> b [ newest ] ; receive_queue [ queue_length ] -> size = size ; receive_queue [ queue_length ] -> queue_index = queue_length ; queue_length ++ ; }
Insert a buffer in the receive queue.
Insert a buffer in the receive queue .
/* Update the buffer if necessary before making it
	 * available to other threads. */