File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -831,15 +831,9 @@ void ClientImpl::shutdown() {
831831 lookupCount_ = 0 ;
832832}
833833
834- uint64_t ClientImpl::newProducerId () {
835- std::shared_lock lock (mutex_);
836- return producerIdGenerator_++;
837- }
834+ uint64_t ClientImpl::newProducerId () { return producerIdGenerator_++; }
838835
839- uint64_t ClientImpl::newConsumerId () {
840- std::shared_lock lock (mutex_);
841- return consumerIdGenerator_++;
842- }
836+ uint64_t ClientImpl::newConsumerId () { return consumerIdGenerator_++; }
843837
844838uint64_t ClientImpl::newRequestId () { return (*requestIdGenerator_)++; }
845839
Original file line number Diff line number Diff line change @@ -207,8 +207,8 @@ class ClientImpl : public std::enable_shared_from_this<ClientImpl> {
207207 std::unordered_map<std::string, LookupServicePtr> redirectedClusterLookupServicePtrs_;
208208 ConnectionPool pool_;
209209
210- uint64_t producerIdGenerator_;
211- uint64_t consumerIdGenerator_;
210+ std:: atomic_uint64_t producerIdGenerator_;
211+ std:: atomic_uint64_t consumerIdGenerator_;
212212 std::shared_ptr<std::atomic<uint64_t >> requestIdGenerator_{std::make_shared<std::atomic<uint64_t >>(0 )};
213213
214214 SynchronizedHashMap<ProducerImplBase*, ProducerImplBaseWeakPtr> producers_;
You can’t perform that action at this time.
0 commit comments