mirror of https://github.com/oxen-io/oxen-mq.git
253f1ee66e
The thread_local `std::map` here can end up being destructed *before* the LokiMQ instance (if both are being destroyed during thread joining), in which case we segfault by trying to use the map. Move the owning container into the LokiMQ instead (indexed by the thread) to prevent that. Also cleans this code up by: - Don't close control sockets from the proxy thread; socket_t's aren't necessarily thread safe so this could be causing issues where we trouble double-closing or using a closed socket. - We can just let them get closed during destruction of the LokiMQ. - Avoid needing shared_ptr's; instead we can just use a unique pointer with raw pointers in the thread_local cache. This simplifies closing because all closing will happen during the LokiMQ destruction. |
||
---|---|---|
.. | ||
address.cpp | ||
address.h | ||
auth.cpp | ||
auth.h | ||
base32z.h | ||
base64.h | ||
batch.h | ||
bt_serialize.cpp | ||
bt_serialize.h | ||
bt_value.h | ||
connections.cpp | ||
connections.h | ||
hex.h | ||
jobs.cpp | ||
lokimq-internal.h | ||
lokimq.cpp | ||
lokimq.h | ||
message.h | ||
proxy.cpp | ||
string_view.h | ||
variant.h | ||
version.h.in | ||
worker.cpp |