[PATCH] D49885: Thread safety analysis: Allow relockable scopes

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 13 05:53:27 PDT 2018


hokein added a comment.

Hello, this patch seems introduce a new crash, and I have reverted it in r339558.

Here is the minimal test case:

  class SCOPED_LOCKABLE FileLock {
   public:
    explicit FileLock()
        EXCLUSIVE_LOCK_FUNCTION(file_);
    ~FileLock() UNLOCK_FUNCTION(file_);
    //void Release() UNLOCK_FUNCTION(file_);
    void Lock() EXCLUSIVE_LOCK_FUNCTION(file_);
    Mutex file_;
  };
  
  void relockShared2() {
    FileLock file_lock;
    file_lock.Lock();
  }


Repository:
  rC Clang

https://reviews.llvm.org/D49885





More information about the cfe-commits mailing list