[PATCH] D19412: [libcxx] Refactor pthread usage - II

Asiri Rathnayake via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 16:39:27 PDT 2016


rmaprath updated this revision to Diff 55119.
rmaprath added a comment.

Addressing review comments from @bcraig:

In the earlier patch, I tried to keep the `__os_support` header to a minimum by not exposing the internal pthread dependencies (in library sources) in this header. This however blew up on me when externalizing the threading support in http://reviews.llvm.org/D19415, where I ended up sprinkling a lot of:

  #if defined(_LIBCPP_THREAD_API_PTHREAD)
    // Do pthread thing
  #elif defined(_LIBCPP_THREAD_API_EXTERNAL)
    // Do other thing
  #else
    // Fault
  #endif

Perhaps the mistake was to view these two threading APIs as unrelated. After hiding all pthread dependencies behind the corresponding `__os_xxxx` functions (as suggested), everything falls into place (http://reviews.llvm.org/D19415 trivially becomes the list of `__os_xxxx` function declarations).

I have addressed the remaining review comments along the way. Will update http://reviews.llvm.org/D19415 soon.

@bcraig: Hope this is much better?


http://reviews.llvm.org/D19412

Files:
  include/__config
  include/__mutex_base
  include/__os_support
  include/mutex
  include/thread
  src/algorithm.cpp
  src/condition_variable.cpp
  src/memory.cpp
  src/mutex.cpp
  src/thread.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19412.55119.patch
Type: text/x-patch
Size: 24695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160426/4b64d079/attachment-0001.bin>


More information about the cfe-commits mailing list