Fix some Helgrind thread errors around simultaneous reads and writes from different threads:
Simultaneous read and write with CURL handle.
Separate tls.timeout_ms member into separate tls.timeout_ms_read and tls.timeout_ms_write members to prevent simultaneous assignment or overwriting.
Separate mqttcurl_test_nonblock() into separate read and write functions to fix simultaneous updates from different read/write threads.
This passes whereas PR https://github.com/wolfSSL/wolfMQTT/pull/395 fails. Apparently the extra locking around SSL struct makes the multithreading CI tests unstable, though it fixes threading errors.
Fixes a subset of thread errors from PR https://github.com/wolfSSL/wolfMQTT/pull/395.
Fix some Helgrind thread errors around simultaneous reads and writes from different threads:
mqttcurl_test_nonblock()
into separate read and write functions to fix simultaneous updates from different read/write threads.This passes whereas PR https://github.com/wolfSSL/wolfMQTT/pull/395 fails. Apparently the extra locking around SSL struct makes the multithreading CI tests unstable, though it fixes threading errors.
Note: ultimately tested with helgrind and drd:
valgrind --tool=helgrind --track-lockorders=yes --free-is-write=yes --fair-sched=yes -s
valgrind --tool=drd --trace-mutex=yes --fair-sched=yes -s