-template<class T>
-fifo<T>::fifo(int limit) : max_(limit)
-{
- VERIFY(pthread_mutex_init(&m_, 0) == 0);
- VERIFY(pthread_cond_init(&non_empty_c_, 0) == 0);
- VERIFY(pthread_cond_init(&has_space_c_, 0) == 0);
-}
-
-template<class T>
-fifo<T>::~fifo()
-{
- //fifo is to be deleted only when no threads are using it!
- VERIFY(pthread_mutex_destroy(&m_)==0);
- VERIFY(pthread_cond_destroy(&non_empty_c_) == 0);
- VERIFY(pthread_cond_destroy(&has_space_c_) == 0);
-}
-
-template<class T> bool
-fifo<T>::size()
-{
- ScopedLock ml(&m_);
- return q_.size();
-}
-