Ejemplo n.º 1
0
static void *thread_producer(void *arg)
{
	ACL_YPIPE *ypipe = (ACL_YPIPE*) arg;
	int   i, j, n = __max / __base;

	for (i = 0; i < n; i++) {
		for (j = 0; j < __base; j++)
			acl_ypipe_write(ypipe, __dummy);
		acl_ypipe_flush(ypipe);
	}

	return NULL;
}
Ejemplo n.º 2
0
int acl_mbox_send(ACL_MBOX *mbox, void *msg)
{
	int ret;

	acl_pthread_mutex_lock(mbox->lock);
	acl_ypipe_write(mbox->ypipe, msg);
	ret = acl_ypipe_flush(mbox->ypipe);
	acl_pthread_mutex_unlock(mbox->lock);
	if (ret == 0)
		return 0;

	mbox->nsend++;

	if (acl_vstream_writen(mbox->out, __key, sizeof(__key) - 1)
		== ACL_VSTREAM_EOF)
	{
		return -1;
	} else
		return 0;

}