WZhuo commented on code in PR #405:
URL: https://github.com/apache/iceberg-cpp/pull/405#discussion_r2605228318


##########
src/iceberg/catalog/memory/in_memory_catalog.cc:
##########
@@ -337,42 +337,42 @@ std::string_view InMemoryCatalog::name() const { return 
catalog_name_; }
 
 Status InMemoryCatalog::CreateNamespace(
     const Namespace& ns, const std::unordered_map<std::string, std::string>& 
properties) {
-  std::lock_guard guard(mutex_);
+  std::unique_lock lock(mutex_);

Review Comment:
   I was wrong — lock_guard can indeed lock a shared_mutex, but it is still 
recommended to use unique_lock and shared_lock for read-write locking on a 
shared_mutex for better code readability.



-- 
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.

To unsubscribe, e-mail: [email protected]

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