예제 #1
0
 /// Pop all queued elements in the order of insertion
 ///
 /// Use concurrent_mpsc_queue::free() to deallocate each node
 node* pop_all(void) {
     node* first = nullptr;
     for (node* tmp, *last = pop_all_reverse(); last; first = tmp) {
         tmp         = last;
         last        = last->m_next;
         tmp->m_next = first;
     }
     return first;
 }
예제 #2
0
 /// Pop all queued elements in the order of insertion
 ///
 /// Use concurrent_mpsc_queue::free() to deallocate each node
 node* pop_all() {
     node* first = nullptr;
     for (node* tmp, *last = pop_all_reverse(); last; first = tmp) {
         tmp     = last;
         last    = last->next();
         tmp->next(first);
     }
     return first;
 }
예제 #3
0
 node * pop_all(void)
 {
   node * last = pop_all_reverse(), * first = 0;
   while(last) {
     node * tmp = last;
     last = last->next;
     tmp->next = first;
     first = tmp;
   }
   return first;
 }
예제 #4
0
 /// Clear the queue
 void clear() {
     for (node* tmp, *last = pop_all_reverse(); last; last = tmp) {
         tmp  = last->next();
         free(last);
     }
 }