Exemplo n.º 1
0
 /* Fills out the supplied vector with all the draw queues.
  * TODO: can I make this better?  It seems silly to do this
  * copy; can I do the draw itself within a foreach()?
  */
 void getDrawQueues(std::vector<std::shared_ptr<QueueType> >& o_drawQueues)
 {
     queues[1 - updateQ.load()].foreach([&o_drawQueues](std::shared_ptr<QueueType>& queue)
     {
         o_drawQueues.push_back(queue);
     });
 }
Exemplo n.º 2
0
void pop(){
	while(count.load()){
		data data;
		if(_que.pop(data)){
			data.num;
		}
	}
}
Exemplo n.º 3
0
    void flipQueues(void)
    {
        updateQ.fetch_xor(1);

        /* Clear the update queue afresh. */
        queues[updateQ.load()].foreach([](std::shared_ptr<QueueType>& queue)
        {
            queue->clear();
        });
    }
Exemplo n.º 4
0
 /* Call this when you're an evaluator thread.  This method
  * gives you a pointer to the queue you should use.
  */
 std::shared_ptr<QueueType> getUpdateQueue(
     unsigned int q)
 {
     return queues[updateQ.load()].lengthen(q);
 }