Skip to content

Commit 20b1560

Browse files
committed
Fix f308 - Prevent race condition in wm_SemLock
1 parent 07eabea commit 20b1560

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/mqtt_client.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,8 @@ static int MqttClient_CancelMessage(MqttClient *client, MqttObject* msg);
201201
return 0;
202202
}
203203

204-
static UINT semstatus;
205204
int wm_SemLock(wm_Sem *s) {
206-
semstatus = tx_semaphore_get(s, TX_WAIT_FOREVER);
205+
UINT semstatus = tx_semaphore_get(s, TX_WAIT_FOREVER);
207206
if (semstatus != TX_SUCCESS) {
208207
return MQTT_TRACE_ERROR(MQTT_CODE_ERROR_SYSTEM);
209208
}

0 commit comments

Comments
 (0)