mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Fix deadlock with Driver::write
Use a spin lock to recheck the queue size until it has room to push.
This commit is contained in:
@@ -297,7 +297,6 @@ void PCAP::writeTask() {
|
||||
auto bs = sendPacket.getBytestream();
|
||||
if(!closing)
|
||||
pcap.sendpacket(interface.fp, bs.data(), (int)bs.size());
|
||||
onWrite();
|
||||
// TODO Handle packet send errors
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,8 +401,6 @@ void VCP::writeTask() {
|
||||
bytesWritten = 0;
|
||||
if(WriteFile(handle, writeOp.bytes.data(), (DWORD)writeOp.bytes.size(), nullptr, &overlappedWrite))
|
||||
continue;
|
||||
|
||||
onWrite();
|
||||
|
||||
auto winerr = GetLastError();
|
||||
if(winerr == ERROR_IO_PENDING) {
|
||||
|
||||
Reference in New Issue
Block a user