Lock TCP socket a little less

This commit is contained in:
Patrick Nicolas
2024-04-14 15:17:39 +02:00
parent eafc048121
commit 2bfe49764a
+1 -2
View File
@@ -344,8 +344,6 @@ xrt::drivers::wivrn::deserialization_packet xrt::drivers::wivrn::TCP::receive_ra
void xrt::drivers::wivrn::TCP::send_raw(const std::vector<std::span<uint8_t>> & spans) void xrt::drivers::wivrn::TCP::send_raw(const std::vector<std::span<uint8_t>> & spans)
{ {
std::lock_guard lock(*mutex);
std::vector<iovec> iovecs; std::vector<iovec> iovecs;
uint16_t size = 0; uint16_t size = 0;
@@ -366,6 +364,7 @@ void xrt::drivers::wivrn::TCP::send_raw(const std::vector<std::span<uint8_t>> &
.msg_flags = 0, .msg_flags = 0,
}; };
std::lock_guard lock(*mutex);
while (true) while (true)
{ {
const auto & data = spans[0]; const auto & data = spans[0];