Fix mosquitto_loop_stop() not stopping on Windows

Closes #1748. Closes #117. Thanks to Sigmund Vik.
pull/1781/head
Roger Light 5 years ago
parent 3eb60e2e6a
commit 4ef48269f5

@ -27,6 +27,7 @@ Client library:
connected. Closes #1725.
- `mosquitto_loop_start()` now sets a thread name on Linux, FreeBSD, NetBSD,
and OpenBSD. Closes #1777.
- Fix `mosquitto_loop_stop()` not stopping on Windows. Closes #1748. Closes #117.
1.6.10 - 2020-05-25

@ -4,6 +4,7 @@
#define pthread_create(A, B, C, D)
#define pthread_join(A, B)
#define pthread_cancel(A)
#define pthread_testcancel()
#define pthread_mutex_init(A, B)
#define pthread_mutex_destroy(A)

@ -256,6 +256,7 @@ int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets)
while(run){
do{
pthread_testcancel();
rc = mosquitto_loop(mosq, timeout, max_packets);
}while(run && rc == MOSQ_ERR_SUCCESS);
/* Quit after fatal errors. */
@ -280,6 +281,7 @@ int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets)
return rc;
}
do{
pthread_testcancel();
rc = MOSQ_ERR_SUCCESS;
state = mosquitto__get_state(mosq);
if(state == mosq_cs_disconnecting || state == mosq_cs_disconnected){

Loading…
Cancel
Save