[PATCH] D11781: Refactored pthread usage in libcxx

Jonathan Roelofs jonathan at codesourcery.com
Wed Aug 5 17:32:16 PDT 2015


jroelofs added a subscriber: jroelofs.

================
Comment at: include/__mutex_base:19
@@ +18,3 @@
+#ifndef _WIN32
+#include <support/pthread/mutex.hpp>
+#endif
----------------
I think it might make sense to create a file: `<support/mutex.h>` where the contents are just:

```
#ifndef _WIN32
#include <support/pthread/mutex.hpp>
#endif
```

And include that file here so that the platform decision of "which mutex implementation should we use" doesn't have these #ifndef guards spread everywhere.

Maybe you could also add some defines & guards to enforce the idea that `<support/pthread/mutex.hpp>` is never included directly, but rather only via `<support/mutex.h>`.

Same should go for thread.hpp, too.


Repository:
  rL LLVM

http://reviews.llvm.org/D11781





More information about the cfe-commits mailing list