morningman commented on a change in pull request #4688:
URL: https://github.com/apache/incubator-doris/pull/4688#discussion_r508949115



##########
File path: be/src/olap/lru_cache.cpp
##########
@@ -420,8 +425,7 @@ Slice ShardedLRUCache::value_slice(Handle* handle) {
 }
 
 uint64_t ShardedLRUCache::new_id() {
-    MutexLock l(&_id_mutex);
-    return ++(_last_id);
+    return _last_id.fetch_add(1, std::memory_order_relaxed);;

Review comment:
       ```suggestion
       return _last_id.fetch_add(1, std::memory_order_relaxed);
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to