1//===-- Linux implementation of the cnd_wait function ---------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "CndVar.h"
10
11#include "src/__support/common.h"
12#include "src/__support/threads/mutex.h"
13#include "src/threads/cnd_wait.h"
14
15namespace LIBC_NAMESPACE {
16
17LLVM_LIBC_FUNCTION(int, cnd_wait, (cnd_t * cond, mtx_t *mtx)) {
18 CndVar *cndvar = reinterpret_cast<CndVar *>(cond);
19 Mutex *mutex = reinterpret_cast<Mutex *>(mtx);
20 return cndvar->wait(m: mutex);
21}
22
23} // namespace LIBC_NAMESPACE
24

source code of libc/src/threads/linux/cnd_wait.cpp