1 //===-- Linux implementation of the cnd_wait function ---------------------===//
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
7 //===----------------------------------------------------------------------===//
11 #include "src/__support/common.h"
12 #include "src/__support/threads/mutex.h"
13 #include "src/threads/cnd_wait.h"
15 namespace __llvm_libc
{
17 LLVM_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(mutex
);
23 } // namespace __llvm_libc