Skip to content

Commit a175f35

Browse files
committed
Unlock mutexes before return
1 parent 8c7962f commit a175f35

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

libraries/SocketWrapper/src/MbedClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ int arduino::MbedClient::available() {
200200
int arduino::MbedClient::read() {
201201
mutex->lock();
202202
if (!available()) {
203+
mutex->unlock();
203204
return -1;
204205
}
205206

@@ -213,6 +214,7 @@ int arduino::MbedClient::read(uint8_t *data, size_t len) {
213214
int avail = available();
214215

215216
if (!avail) {
217+
mutex->unlock();
216218
return -1;
217219
}
218220

libraries/SocketWrapper/src/MbedServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ arduino::MbedClient arduino::MbedServer::available(uint8_t* status) {
5252
}
5353
return client;
5454
}
55-
*/
55+
*/

0 commit comments

Comments
 (0)