<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/69612>69612</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Add new check to detect `std::condition_variable::notify_all` without release `std::mutex`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy,
            check-request
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          HerrCai0907
      </td>
    </tr>
</table>

<pre>
    Those code has performance issue and even is bug-prone
```c++
std::conditional_variable cv;
std::mutex mu;

void wait() {
  std::unique_lock<std::mutex> lock{mu};
 cv.wait(lock);
}

void notify() {
  std::lock_gurad<std::mutex> lock{mu};
  cv.notify_all(); // notify but without release mutex
 cv.notify_once(); // notify but without release mutex
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck82OozoQhZ-m2JQSGfMXL1gknRvdB7j7yNgF-LbB3f5JT7_9CMike6alkWYkC6RT-PNx1UGGYIaZqIXqBNU5kymOzrf_kvdP0jDBmqxz-r39b3SBUDlNOMqAL-R75yc5K0ITQiKUs0a60YwmYJeG3Yt3MwE7AztCzbalgJ-WtaohaiiOUByVm7WJxs3SXm_SG9lZQnWD4tcPpxTpG07pUdmeN2c0vkkTgR-AC4TmXkZ8bE2zeU10tU49Q_H0MxGKf3AtNKcpQXN-4FHd9nfuWufi4-Tm_MXC7KLp339jYoFch-Sl_gMPi4mNfJXWbnQoTgj8AvxyPxS7FPHNxNGliJ4syUC4gR83uUPcrOgvKR-X_jHQTLeFFoWQGbV5LZqm4Jzl2djmfd33QvOq7EStG12Wsiurrm96WfEm7zLTcsaLnOUir_O6EHtRCXE4HEquqGKyaaBkNElj99bepr3zQ7bmrK1FnfPMyo5sWEPLubJyHnbR6HfgHPjTIo2knneeXhOFuKjVOfPtgtp1aQhQMmtCDB_waKKl9qg1zvSG63aMDjVFUhGhZl_j-gjrpn8aUs2-tPEzYWtpzbLkbTvG-BIWfZ3EYOKYur1yE_DLYu7-Wn6n_0lF4Je1DQH4Ze3E9wAAAP__jGIlqA">