[PATCH] D31163: Implement Pp0156r2 "Variadic Lock Guard, version 5"

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 20 19:10:18 PDT 2017


mclow.lists created this revision.

WG21 has decided that the ABI-breaking `lock_guard` proposal that we (@EricWF) implemented (and hid behind an ABI-break macro) is not the way to go. Instead, we're introducing a new class, `scoped_lock`, which is variadic, and leaving `lock_guard` as non-variadic.

So, delete Eric's work, nuke the ABI macro, and implement the non-ABI breaking stuff.

While I'm in the neighborhood, implement the mutex-ey parts of P0433: "Deduction guides for the standard library". This bit has the guides for `lock_guard`, `scoped_lock`, `unique_lock`, and `shared_lock`.

Note: If you're using the variadic version of `lock_guard`, then this is a breaking change.  Good news is that you just switch to using `scoped_lock`, and everything works the same.


https://reviews.llvm.org/D31163

Files:
  include/__config
  include/__mutex_base
  include/mutex
  include/shared_mutex
  test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/assign.fail.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/copy.fail.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.fail.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/types.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
  test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31163.92415.patch
Type: text/x-patch
Size: 39850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170321/334f9aeb/attachment-0001.bin>


More information about the cfe-commits mailing list