Skip to content

Commit 0a86d6f

Browse files
authored
Merge pull request #893 from redboltz/make_thread_local_uuid_gen
Made uuid gen to thread_local.
2 parents abd766e + a95250a commit 0a86d6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/mqtt/broker/uuid.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MQTT_BROKER_NS_BEGIN
1919

2020
inline std::string create_uuid_string() {
2121
// See https://github.com/boostorg/uuid/issues/121
22-
auto gen = boost::uuids::random_generator();
22+
static thread_local auto gen = boost::uuids::random_generator();
2323
return boost::uuids::to_string(gen());
2424
}
2525

0 commit comments

Comments
 (0)