Replace concurrentqueue with ringbuffer

This commit is contained in:
Jonathan Schwartz
2024-04-05 17:24:53 +00:00
parent 7d2d12c5cd
commit 63f0516318
22 changed files with 361 additions and 169 deletions
+2 -4
View File
@@ -140,9 +140,8 @@ bool CDCACM::close() {
int ret = ::close(fd);
fd = -1;
uint8_t flush;
WriteOperation flushop;
while (readQueue.try_dequeue(flush)) {}
readBuffer.clear();
while (writeQueue.try_dequeue(flushop)) {}
if(modeChanging) {
@@ -191,8 +190,7 @@ void CDCACM::readTask() {
}
std::cout << std::dec << std::endl;
#endif
readQueue.enqueue_bulk(readbuf, bytesRead);
readBuffer.write(readbuf, bytesRead);
} else {
if(modeChanging) {
// We were expecting a disconnect for reenumeration