Skip to content

Commit f5029d4

Browse files
committed
Use .at() to select send_mutices_
1 parent 31187b9 commit f5029d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/nadjieb/mjpeg_streamer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class MJPEGStreamer
238238

239239
int n;
240240
{
241-
std::unique_lock<std::mutex> lock(this->send_mutices_[payload.sd % NUM_SEND_MUTICES]);
241+
std::unique_lock<std::mutex> lock(this->send_mutices_.at(payload.sd % NUM_SEND_MUTICES));
242242
n = ::write(payload.sd, msg.c_str(), msg.size());
243243
}
244244

@@ -315,7 +315,7 @@ class MJPEGStreamer
315315
}
316316

317317
{
318-
std::unique_lock<std::mutex> lock(this->send_mutices_[new_socket % NUM_SEND_MUTICES]);
318+
std::unique_lock<std::mutex> lock(this->send_mutices_.at(new_socket % NUM_SEND_MUTICES));
319319
::write(new_socket, header.c_str(), header.size());
320320
}
321321

0 commit comments

Comments
 (0)