bkietz commented on a change in pull request #8305:
URL: https://github.com/apache/arrow/pull/8305#discussion_r500297392
##########
File path: cpp/src/arrow/util/mutex.h
##########
@@ -31,16 +31,20 @@ namespace util {
class ARROW_EXPORT Mutex {
public:
Mutex();
+ Mutex(Mutex&&) = default;
+ Mutex& operator=(Mutex&&) = default;
/// A Guard is falsy if a lock could not be acquired.
- class Guard {
+ class ARROW_EXPORT Guard {
public:
Guard() : locked_(NULLPTR, [](Mutex* mutex) {}) {}
Guard(Guard&&) = default;
Guard& operator=(Guard&&) = default;
explicit operator bool() const { return bool(locked_); }
+ void Unlock();
Review comment:
I'd prefer to continue acquiring new locks exclusively through
Mutex::Lock; there's no loss of generality and it keeps Guard as simple as
possible
----------------------------------------------------------------
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]