xref: /llvm-project/libc/src/threads/linux/cnd_destroy.cpp (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
12f4f452fSSiva Chandra Reddy //===-- Linux implementation of the cnd_destroy function ------------------===//
22f4f452fSSiva Chandra Reddy //
32f4f452fSSiva Chandra Reddy // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42f4f452fSSiva Chandra Reddy // See https://llvm.org/LICENSE.txt for license information.
52f4f452fSSiva Chandra Reddy // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
62f4f452fSSiva Chandra Reddy //
72f4f452fSSiva Chandra Reddy //===----------------------------------------------------------------------===//
82f4f452fSSiva Chandra Reddy 
92f4f452fSSiva Chandra Reddy #include "src/threads/cnd_destroy.h"
102f4f452fSSiva Chandra Reddy #include "src/__support/common.h"
11*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
125442e15aSNick Desaulniers (paternity leave) #include "src/__support/threads/CndVar.h"
135442e15aSNick Desaulniers (paternity leave) 
145442e15aSNick Desaulniers (paternity leave) #include <threads.h> // cnd_t
152f4f452fSSiva Chandra Reddy 
16*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
172f4f452fSSiva Chandra Reddy 
185442e15aSNick Desaulniers (paternity leave) static_assert(sizeof(CndVar) == sizeof(cnd_t));
195442e15aSNick Desaulniers (paternity leave) 
208379fc4aSSiva Chandra Reddy LLVM_LIBC_FUNCTION(void, cnd_destroy, (cnd_t * cond)) {
218379fc4aSSiva Chandra Reddy   CndVar *cndvar = reinterpret_cast<CndVar *>(cond);
228379fc4aSSiva Chandra Reddy   CndVar::destroy(cndvar);
238379fc4aSSiva Chandra Reddy }
242f4f452fSSiva Chandra Reddy 
25*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
26