Threaded mode is deconfigured when the mosquitto_loop_start() thread ends,
which allows mosquitto_loop_start() to be called again.
Closes#2242. Thanks to Timo Lange.
This fixes the following error, when compiling for systems without
pthread support, and when passing WITH_THREADING=no to make:
thread_mosq.c:24:12: fatal error: pthread.h: No such file or directory
# include <pthread.h>
^~~~~~~~~~~
compilation terminated.
Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
Thus mosquitto_loop_start() and mosquitto_loop_stop()
won't be available there (and mosquitto_connect_async()
as a consequence).
Signed-off-by: Daniel d'Andrada <daniel.dandrada@esrlabs.com>
The connection wouldn't always complete if mosquitto_loop_start() was
called before mosquitto_connect_async(). Closes#848.
Thanks to Ian Gough.
Bug: https://github.com/eclipse/mosquitto/issues/848
Signed-off-by: Roger A. Light <roger@atchoo.org>
libmosquitto shouldn't cancel threads it didn't create. This change
allows us to keep track of whether threads were created by the library
or by external code.
Thanks to Josip Ćavar.
Bug: https://github.com/eclipse/mosquitto/issues/166