Skip to content

Commit dc4f16a

Browse files
committed
Removed unused serial port mutex
1 parent 8dac2fd commit dc4f16a

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

qt/serial_port.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ int SerialPort::asyncRead(char *buf, int size, std::function<void(int)> cb)
8080

8181
void SerialPort::onRead(const boost::system::error_code &ec, size_t bytesRead)
8282
{
83-
boost::mutex::scoped_lock look(mutex);
84-
8583
if (ec)
8684
{
8785
std::cerr << "Read error: " << ec.message() << std::endl;
@@ -122,8 +120,6 @@ int SerialPort::asyncReadWithTimeout(char *buf, int size,
122120
void SerialPort::onReadWithTimeout(const boost::system::error_code &ec,
123121
size_t bytesRead)
124122
{
125-
boost::mutex::scoped_lock look(mutex);
126-
127123
timer->cancel();
128124
timer = nullptr;
129125

@@ -183,8 +179,6 @@ bool SerialPort::start(const char *portName, int baudRate)
183179

184180
void SerialPort::stop()
185181
{
186-
boost::mutex::scoped_lock look(mutex);
187-
188182
if (timer)
189183
{
190184
timer->cancel();

qt/serial_port.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class SerialPort
2424
boost::asio::io_service ioService;
2525
thread_ptr thread;
2626
serial_port_ptr port;
27-
boost::mutex mutex;
2827
timer_ptr timer;
2928
std::function<void(int)> readCb;
3029

0 commit comments

Comments
 (0)