The class is not safely movable and not thread-safe for concurrent configure/send without extra locking or explicit ownership guarantees.
-
HttpRESTClient(HttpRESTClient&& src) does not move or initialize singletonInstance or pool.
singletonInstance is left empty in the moved-to object.
pool is default-constructed again with a lambda capturing the new this, but any pending tasks in the source object still use the old object.
-
pool’s worker lambda captures this by reference:
- if the source is moved-from or destroyed while async work remains queued, queued tasks can call
dispatchCallback(...) / send(...) on a dangling object.
-
configure() and sendAsync() / send() share mutable members without synchronization:
_config is mutated in configure() and read in send()/prepareContext().
_callback is mutated in configure() and read in sendAsync() / dispatchCallback().
- These are plain non-atomic objects, so concurrent use is a data race.
-
dispatchCallback may invoke _callback from the worker thread with no lock if arg.callback is empty.
The class is not safely movable and not thread-safe for concurrent configure/send without extra locking or explicit ownership guarantees.
HttpRESTClient(HttpRESTClient&& src)does not move or initializesingletonInstanceorpool.singletonInstanceis left empty in the moved-to object.poolis default-constructed again with a lambda capturing the newthis, but any pending tasks in the source object still use the old object.pool’s worker lambda capturesthisby reference:dispatchCallback(...)/send(...)on a dangling object.configure()andsendAsync()/send()share mutable members without synchronization:_configis mutated inconfigure()and read insend()/prepareContext()._callbackis mutated inconfigure()and read insendAsync()/dispatchCallback().dispatchCallbackmay invoke_callbackfrom the worker thread with no lock ifarg.callbackis empty.