[PATCH] [libc++] Allow libc++ to be built on systems without POSIX threads
Eric Fiselier
eric at efcs.ca
Thu Aug 21 16:07:57 PDT 2014
================
Comment at: src/mutex.cpp:224-233
@@ -218,9 +223,11 @@
void
__call_once(volatile unsigned long& flag, void* arg, void(*func)(void*))
{
+#ifndef _LIBCPP_HAS_NO_THREADS
pthread_mutex_lock(&mut);
while (flag == 1)
pthread_cond_wait(&cv, &mut);
+#endif // !_LIBCPP_HAS_NO_THREADS
if (flag == 0)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
----------------
Wouldn't it be a lot cleaner to just separate the two implementation entirely instead of interweaving them like this?
http://reviews.llvm.org/D3969
More information about the cfe-commits
mailing list