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

    <tr>
        <th>Summary</th>
        <td>
            [libc] replace MutexLock with cpp::lock_guard
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            code-cleanup,
            libc
      </td>
    </tr>

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

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

<pre>
    MutexLock in src/__support/threads/mutex.h smells like std::lock_guard.  We should:
1. move it to src/__support/CPP/mutex.h (or better yet, just create a new file. This RAII wrapper is trivial IMO to implement)
2. rename it to lock_guard
3. update the references to MutexLock to now refer to cpp::lock_guard
4. explicitly delete the copy assignment operator
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUkFr3DwU_DXy5RHjlexv7YMP-2VZCDQ0lEKPQZaebWVlS0hP2ey_L_KmTSg5med5mhmNRsZophWxZ83_rDkWMtHsQr8addYYZbKrwRCLwelr_5gI3745dQazQgyK8dPzc0zeu0CMn2gOKHVk_LTkxXKGuKC1Eaw5I0TSTByYOFinzs9TkkGXAL8Q4uyS3bDqyKrDroTFvSIYAnJfqNw_PX1SYLx1AQYkwgBXJMbv4SVFAhVQEoKEFS8wGosl_JxNhB-Hhwe4BOk9BjARKJhXIy08PH7PembxFhdcifHu5oeXEHCVyx9HH_ZvuCgheZ21aEYIOGLAVWHMux-BkYPVXW5wHpT3_6Zxo6tLwDdvjTJkr6DR4juzcv4Kt9fK_sB5DJJcKHQvdCc6WWC_2--E2FX7ri7mvhJCKaEb0Q5SjV2r5dhKLpCj2DVdrQvT84rXVb37jwvRNXUpOt2K_b7Vsm1ENWpWV7hIY0trX5fShakwMSbs266qeGHlgDZuveF8ck7DaEIk2HYY54zfM86V03inLMo1-b8_rRlUHppjEfpMfjekKbK6siZS_JAjQ3Zr5nagOUJAb6XCT8FeDM1fpVmkYPuZyMeM8BPjp8nQnIZSuYXxU9Z4_9z54F5Q5XJt3nODtyv-DgAA__-F2AcF">