<div dir="ltr">In C++17, we introduced a new variadic class called scoped_lock.<div>It took a set of mutexes, and locked them all (in the constructor) and unlocked them all (in the destructor).  It also has an option to "adopt" the locks (i.e, you can pass it already locked mutexes and it will not lock them again).</div><div><br></div><div>The constructors look like this (as originally defined):</div><div><br></div><div>class scoped_lock {</div><div>...</div><div><div>    explicit scoped_lock(MutexTypes&... m);</div><div>    scoped_lock(MutexTypes&... m, adopt_lock_t);</div></div><div>...</div><div>};</div><div><br></div><div>but this caused some problems with template deduction (specifically in deduction guides)</div><div>So, at the last minute in the C++17 cycle, the committee decided to change the second constructor to take the `adopt_lock` flag AT THE START.</div><div><br></div><div><div>class scoped_lock {</div><div>...</div><div><div>    explicit scoped_lock(MutexTypes&... m);</div><div>    scoped_lock(adopt_lock_t, MutexTypes&... m);</div></div><div>...</div><div>};</div></div><div><br></div><div>scoped_lock is a new feature in C++17, and so the installed base of people using it should be very small. There are no uses of it in the LLVM code base outside of the libc++ test suite.</div><div><br></div><div>I'm going to make this change to bring libc++ in conformance with the (hopefully final) standard, and people who are using the old call will have to update their code. Sorry about that.</div><div><br></div><div>-- Marshall</div><div><br></div><div>P.S. Only people who are using the second constructor (the one with adopt_lock) will be affected by this change.</div><div><br></div></div>