예제 #1
0
파일: fair.hpp 프로젝트: KaiEkkrin/afk
    void flipQueues(void)
    {
        updateQ.fetch_xor(1);

        /* Clear the update queue afresh. */
        queues[updateQ.load()].foreach([](std::shared_ptr<QueueType>& queue)
        {
            queue->clear();
        });
    }
예제 #2
0
파일: fair.hpp 프로젝트: KaiEkkrin/afk
 /* 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);
     });
 }
예제 #3
0
void pop(){
	while(count.load()){
		data data;
		if(_que.pop(data)){
			data.num;
		}
	}
}
예제 #4
0
파일: fair.hpp 프로젝트: KaiEkkrin/afk
 /* 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);
 }