5 #ifndef CVMFS_INGESTION_TUBE_H_
6 #define CVMFS_INGESTION_TUBE_H_
38 template <
class ItemT>
60 Link *prev = cursor->
prev_;
63 }
while (cursor !=
head_);
67 pthread_mutex_destroy(&
lock_);
79 Link *link =
new Link(item);
99 Link *link =
new Link(item);
162 Link *sentinel =
new Link(NULL);
166 int retval = pthread_mutex_init(&
lock_, NULL);
179 link->prev_->next_ = link->next_;
180 link->next_->prev_ = link->prev_;
181 ItemT *item = link->item_;
230 template <
class ItemT>
238 for (
unsigned i = 0; i <
tubes_.size(); ++i)
258 unsigned tube_idx = (
tubes_.size() == 1)
259 ? 0 : (item->tag() %
tubes_.size());
260 return tubes_[tube_idx]->EnqueueBack(item);
268 unsigned tube_idx = (
tubes_.size() == 1)
270 return tubes_[tube_idx]->EnqueueBack(item);
279 #endif // CVMFS_INGESTION_TUBE_H_
Tube< ItemT >::Link * DispatchAny(ItemT *item)
ItemT * Slice(Link *link)
assert((mem||(size==0))&&"Out Of Memory")
pthread_cond_t cond_empty_
atomic_int32 round_robin_
pthread_cond_t cond_populated_
ItemT * SliceUnlocked(Link *link)
Link * EnqueueFront(ItemT *item)
Link * EnqueueBack(ItemT *item)
Tube< ItemT >::Link * Dispatch(ItemT *item)
void TakeTube(Tube< ItemT > *t)
pthread_cond_t cond_capacious_
std::vector< Tube< ItemT > * > tubes_