Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions libc/src/__support/threads/linux/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,19 @@ class Barrier {
int wait();
};

static_assert(
sizeof(Barrier) == sizeof(pthread_barrier_t),
"The public pthread_barrier_t type cannot accommodate the internal "
"barrier type.");

static_assert(alignof(Barrier) == alignof(pthread_barrier_t),
"The public pthread_barrier_t type has a different alignment "
"than the internal barrier type.");
static_assert(sizeof(Barrier) <= sizeof(pthread_barrier_t),
"The public pthread_barrier_t type cannot accommodate the "
"internal barrier type.");

static_assert(alignof(Barrier) <= alignof(pthread_barrier_t),
"The public pthread_barrier_t type has insufficient alignment "
"for the internal barrier type.");

static_assert(sizeof(CndVar) <= 24,
"CndVar size exceeds the size in __barrier_type.h");

static_assert(sizeof(Mutex) <= 24,
"Mutex size exceeds the size in __barrier_type.h");

} // namespace LIBC_NAMESPACE_DECL

Expand Down
Loading