mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-13 00:45:42 -04:00
Make FIFO::in() more consistent with other functions.
This commit is contained in:
parent
4059e9cebe
commit
2cd28fcc0c
1 changed files with 8 additions and 6 deletions
|
@ -63,13 +63,15 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool in(const T& val) {
|
bool in(const T& val) {
|
||||||
const bool is_not_full = !is_full();
|
if( is_full() ) {
|
||||||
if( is_not_full ) {
|
return false;
|
||||||
_data[_in & mask()] = val;
|
|
||||||
smp_wmb();
|
|
||||||
_in++;
|
|
||||||
}
|
}
|
||||||
return is_not_full;
|
|
||||||
|
_data[_in & mask()] = val;
|
||||||
|
smp_wmb();
|
||||||
|
_in += 1;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t in(const T* const buf, size_t len) {
|
size_t in(const T* const buf, size_t len) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue