[libc-commits] [libc] [libc] Implement barriers for pthreads (PR #148948)

Uzair Nawaz via libc-commits libc-commits at lists.llvm.org
Fri Jul 25 17:00:22 PDT 2025


================
@@ -0,0 +1,118 @@
+//===-- Tests for pthread_barrier_t ---------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/pthread/pthread_barrier_destroy.h"
+#include "src/pthread/pthread_barrier_init.h"
+#include "src/pthread/pthread_barrier_wait.h"
+
+#include "src/__support/CPP/atomic.h"
+#include "src/pthread/pthread_create.h"
+#include "src/pthread/pthread_join.h"
+#include "src/pthread/pthread_mutex_destroy.h"
+#include "src/pthread/pthread_mutex_init.h"
+#include "src/pthread/pthread_mutex_lock.h"
+#include "src/pthread/pthread_mutex_unlock.h"
+#include "src/stdio/printf.h"
+#include "src/string/memset.h"
+
+#include "test/IntegrationTest/test.h"
+
+#include <pthread.h>
----------------
uzairnawaz wrote:

There are many pthread types defined in include/llvm-libc-types that don't have corresponding proxy headers in hdr/types yet. I created proxy headers for the barrier structs in this patch, but I think it may make sense to have a separate patch for creating all of those additional proxy headers. 

https://github.com/llvm/llvm-project/pull/148948


More information about the libc-commits mailing list