From ea46a8188e06e196542d8cfbae2c1b2ea710aeb0 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 6 Apr 2021 14:51:30 +0100 Subject: [PATCH] Add more documentation on pthread support. --- README.md | 7 +++++-- include/mosquitto.h | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ed99f60..a0d275e8 100644 --- a/README.md +++ b/README.md @@ -67,11 +67,14 @@ already be built. Use `make binary` to skip building the man pages, or install ### Build Dependencies * c-ares (libc-ares-dev on Debian based systems) - only when compiled with `make WITH_SRV=yes` +* cJSON - for client JSON output support. Disable with `make WITH_CJSON=no` Auto detected with CMake. * libwebsockets (libwebsockets-dev) - enable with `make WITH_WEBSOCKETS=yes` * openssl (libssl-dev on Debian based systems) - disable with `make WITH_TLS=no` -* xsltproc (xsltproc and docbook-xsl on Debian based systems) - only needed when building from git sources - disable with `make WITH_DOCS=no` +* pthreads - for client library thread support. This is required to support the + `mosquitto_loop_start()` and `mosquitto_loop_stop()` functions. If compiled + without pthread support, the library isn't guaranteed to be thread safe. * uthash / utlist - bundled versions of these headers are provided, disable their use with `make WITH_BUNDLED_DEPS=no` -* cJSON - for client JSON output support. Disable with `make WITH_CJSON=no` Auto detected with CMake. +* xsltproc (xsltproc and docbook-xsl on Debian based systems) - only needed when building from git sources - disable with `make WITH_DOCS=no` Equivalent options for enabling/disabling features are available when using the CMake build. diff --git a/include/mosquitto.h b/include/mosquitto.h index 02c49fcd..e7e09d70 100644 --- a/include/mosquitto.h +++ b/include/mosquitto.h @@ -165,6 +165,9 @@ typedef struct mqtt5__property mosquitto_property; * libmosquitto provides thread safe operation, with the exception of * which is not thread safe. * + * If the library has been compiled without thread support it is *not* + * guaranteed to be thread safe. + * * If your application uses threads you must use to * tell the library this is the case, otherwise it makes some optimisations * for the single threaded case that may result in unexpected behaviour for