Make rxQueue lock-free using an atomic counter ring buffer.

This commit is contained in:
Adam Ierymenko 2017-08-08 13:21:10 -07:00
parent 7e6598e9ca
commit e3cf756785
3 changed files with 33 additions and 39 deletions

View file

@ -47,6 +47,15 @@ public:
_v = 0;
}
inline int load() const
{
#ifdef __GNUC__
return __sync_or_and_fetch(&_v,0);
#else
return _v.load();
#endif
}
inline int operator++()
{
#ifdef __GNUC__