Github user ClydeZhao commented on the issue:

    https://github.com/apache/orc/pull/65
  
    Should we write our own? It is not complicated after all. I am thinking a 
class like this would be good enough:
    ```c++
      /**
       * Lock guard for pthread_mutex_t object using RAII
       * The Lock is automatically release when exiting current scope.
       */
      class Lock {
        public:
          explicit Lock(pthread_mutex_t* mutex) : mutex_ptr_(mutex) {
            pthread_mutex_lock(mutex_ptr_);
          }
          ~Lock() { pthread_mutex_unlock(mutex_ptr_); }
        private:
           // no default constructor
           Lock();
           // prohibit copying
           Lock(const Lock&);
           Lock& operator=(const Lock&);
    
           pthread_mutex_t* mutex_ptr_;
      };
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to