Revert "Try factoring out a mutex to see if its faster."

This reverts commit 982c32322b.
This commit is contained in:
Adam Ierymenko 2020-11-17 12:52:48 -08:00
parent 982c32322b
commit 4bd58d47cf
2 changed files with 15 additions and 32 deletions

View file

@ -28,9 +28,6 @@
#include "EthernetTap.hpp"
#include "BlockingQueue.hpp"
#define ZT_BUFFER_POOL_SIZE 64
#define ZT_BUFFER_POOL_MASK 63U
namespace ZeroTier {
class LinuxEthernetTap : public EthernetTap
@ -76,8 +73,7 @@ private:
std::thread _tapReaderThread;
std::thread _tapProcessorThread;
std::mutex _buffers_l;
std::atomic<uintptr_t> _buffers[ZT_BUFFER_POOL_SIZE];
std::atomic<uintptr_t> _bufferReadPtr,_bufferWritePtr;
std::vector<void *> _buffers;
BlockingQueue< std::pair<void *,int> > _tapq;
};