Skip to content

Commit 7bbd476

Browse files
committed
make barrier linux-only for now as mutex/cndvars are only defined for it
1 parent 4373ef7 commit 7bbd476

File tree

8 files changed

+18
-19
lines changed

8 files changed

+18
-19
lines changed

libc/src/__support/threads/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,6 @@ if(TARGET libc.src.__support.threads.${LIBC_TARGET_OS}.CndVar)
9090
)
9191
endif()
9292

93-
add_object_library(
94-
barrier
95-
HDRS
96-
barrier.h
97-
SRCS
98-
barrier.cpp
99-
DEPENDS
100-
.CndVar
101-
.mutex
102-
)
103-
10493
if (LLVM_LIBC_FULL_BUILD)
10594
set(identifier_dependency_on_thread libc.src.__support.threads.thread)
10695
endif()

libc/src/__support/threads/linux/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,14 @@ add_object_library(
121121
libc.src.__support.threads.linux.raw_mutex
122122
libc.src.__support.CPP.mutex
123123
)
124+
125+
add_object_library(
126+
barrier
127+
HDRS
128+
barrier.h
129+
SRCS
130+
barrier.cpp
131+
DEPENDS
132+
libc.src.__support.threads.CndVar
133+
libc.src.__support.threads.mutex
134+
)

libc/src/__support/threads/barrier.cpp renamed to libc/src/__support/threads/linux/barrier.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/threads/barrier.h"
10-
#include "barrier.h"
9+
#include "src/__support/threads/linux/barrier.h"
1110
#include "hdr/errno_macros.h"
1211
#include "src/__support/threads/CndVar.h"
1312
#include "src/__support/threads/mutex.h"
File renamed without changes.

libc/src/pthread/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ add_entrypoint_object(
280280
DEPENDS
281281
libc.src.errno.errno
282282
libc.include.pthread
283-
libc.src.__support.threads.barrier
283+
libc.src.__support.threads.linux.barrier
284284
)
285285

286286
add_entrypoint_object(
@@ -291,7 +291,7 @@ add_entrypoint_object(
291291
pthread_barrier_destroy.h
292292
DEPENDS
293293
libc.include.pthread
294-
libc.src.__support.threads.barrier
294+
libc.src.__support.threads.linux.barrier
295295
)
296296

297297
add_entrypoint_object(
@@ -302,7 +302,7 @@ add_entrypoint_object(
302302
pthread_barrier_wait.h
303303
DEPENDS
304304
libc.include.pthread
305-
libc.src.__support.threads.barrier
305+
libc.src.__support.threads.linux.barrier
306306
)
307307

308308
add_entrypoint_object(

libc/src/pthread/pthread_barrier_destroy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "hdr/types/pthread_barrier_t.h"
1212
#include "src/__support/common.h"
1313
#include "src/__support/macros/config.h"
14-
#include "src/__support/threads/barrier.h"
14+
#include "src/__support/threads/linux/barrier.h"
1515

1616
namespace LIBC_NAMESPACE_DECL {
1717

libc/src/pthread/pthread_barrier_init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "hdr/types/pthread_barrierattr_t.h"
1313
#include "src/__support/common.h"
1414
#include "src/__support/macros/config.h"
15-
#include "src/__support/threads/barrier.h"
15+
#include "src/__support/threads/linux/barrier.h"
1616

1717
namespace LIBC_NAMESPACE_DECL {
1818

libc/src/pthread/pthread_barrier_wait.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "hdr/types/pthread_barrier_t.h"
1212
#include "src/__support/common.h"
1313
#include "src/__support/macros/config.h"
14-
#include "src/__support/threads/barrier.h"
14+
#include "src/__support/threads/linux/barrier.h"
1515

1616
namespace LIBC_NAMESPACE_DECL {
1717

0 commit comments

Comments
 (0)