Esempio n. 1
0
void APollQ::StartPolledQueueTasks(CCheckTask *pCheckTask, UBaseType_t nPriority ) {
	static CQueue queue;

	/* Create the queue used by the producer and consumer. */
	queue.Create(pollqQUEUE_SIZE, (UBaseType_t) sizeof(unsigned short));

	/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
	in use.  The queue registry is provided as a means for kernel aware
	debuggers to locate queues and has no purpose if a kernel aware debugger
	is not being used.  The call to vQueueAddToRegistry() will be removed
	by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
	defined to be less than 1. */
	queue.AddToRegistry("Poll_Test_Queue");

	/* Spawn the producer and consumer. */
	static CPollQConsumer consumer(pCheckTask, &queue);
	consumer.Create("QConsNB", pollqSTACK_SIZE, nPriority);
	static CPollQProducer producer(pCheckTask, &queue);
	producer.Create("QProdNB", pollqSTACK_SIZE, nPriority);
}