[libc-commits] [libc] [libc][pthreads] pthread_cond_{destroy|init|signal|wait} (PR #88583)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Mon Apr 15 12:48:26 PDT 2024


================
@@ -0,0 +1,35 @@
+//===-- Linux implementation of the pthread_cond_signal function ----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "pthread_cond_signal.h"
+
+#include "include/llvm-libc-macros/generic-error-number-macros.h" // EINVAL
+#include "src/__support/common.h"
+#include "src/threads/linux/CndVar.h"
+
+#include <pthread.h> // pthread_cond_t
+// TODO: https://github.com/llvm/llvm-project/issues/88580
+#include <threads.h> // thrd_success
+
+namespace LIBC_NAMESPACE {
+
+LLVM_LIBC_FUNCTION(int, pthread_cond_signal, (pthread_cond_t * cond)) {
+  if (!cond)
+    return EINVAL;
----------------
nickdesaulniers wrote:

Interestingly, bionic does not check for nullptr args.

https://android-review.googlesource.com/c/platform/bionic/+/84016

https://github.com/llvm/llvm-project/pull/88583


More information about the libc-commits mailing list