orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ClydeZhao <...@git.apache.org>
Subject [GitHub] orc issue #65: ORC-110: [C++] getTimezoneByFilename is not thread safe
Date Fri, 18 Nov 2016 13:44:14 GMT
Github user ClydeZhao commented on the issue:

    Should we write our own? It is not complicated after all. I am thinking a class like this
would be good enough:
       * Lock guard for pthread_mutex_t object using RAII
       * The Lock is automatically release when exiting current scope.
      class Lock {
          explicit Lock(pthread_mutex_t* mutex) : mutex_ptr_(mutex) {
          ~Lock() { pthread_mutex_unlock(mutex_ptr_); }
           // no default constructor
           // 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message