Skip to content

Commit c6e356e

Browse files
Fixed occasional hang in sample (aws#10)
1 parent b0b8a18 commit c6e356e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

samples/mqtt_pub_sub/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,8 @@ int main(int argc, char* argv[])
323323
};
324324

325325
packetId = connection->Subscribe("a/b", AWS_MQTT_QOS_AT_LEAST_ONCE, onPublish, onSubAck);
326-
conditionVariable.wait(uniqueLock);
327-
328326
waitForSub = false;
327+
conditionVariable.wait(uniqueLock);
329328
/*
330329
* Unsubscribe from the topic.
331330
*/

0 commit comments

Comments
 (0)