mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Purge read and write queues after a close succeeds
This commit is contained in:
@@ -256,6 +256,11 @@ bool STM32::close() {
|
||||
|
||||
int ret = ::close(fd);
|
||||
fd = -1;
|
||||
|
||||
uint8_t flush;
|
||||
WriteOperation flushop;
|
||||
while (readQueue.try_dequeue(flush)) {}
|
||||
while (writeQueue.try_dequeue(flushop)) {}
|
||||
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user