Make FIFO::in() more consistent with other functions.

This commit is contained in:
Jared Boone 2016-01-06 11:04:25 -08:00
parent 4059e9cebe
commit 2cd28fcc0c

View File

@ -63,13 +63,15 @@ public:
}
bool in(const T& val) {
const bool is_not_full = !is_full();
if( is_not_full ) {
_data[_in & mask()] = val;
smp_wmb();
_in++;
if( is_full() ) {
return false;
}
return is_not_full;
_data[_in & mask()] = val;
smp_wmb();
_in += 1;
return true;
}
size_t in(const T* const buf, size_t len) {