summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lldb/tools/debugserver/source/PThreadCondition.h
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
committerpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
commit061da546b983eb767bad15e67af1174fb0bcf31c (patch)
tree83c78b820819d70aa40c36d90447978b300078c5 /gnu/llvm/lldb/tools/debugserver/source/PThreadCondition.h
parentImport LLVM 10.0.0 release including clang, lld and lldb. (diff)
downloadwireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.tar.xz
wireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.zip
Import LLVM 10.0.0 release including clang, lld and lldb.
ok hackroom tested by plenty
Diffstat (limited to 'gnu/llvm/lldb/tools/debugserver/source/PThreadCondition.h')
-rw-r--r--gnu/llvm/lldb/tools/debugserver/source/PThreadCondition.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnu/llvm/lldb/tools/debugserver/source/PThreadCondition.h b/gnu/llvm/lldb/tools/debugserver/source/PThreadCondition.h
new file mode 100644
index 00000000000..2f9060da028
--- /dev/null
+++ b/gnu/llvm/lldb/tools/debugserver/source/PThreadCondition.h
@@ -0,0 +1,34 @@
+//===-- PThreadCondition.h --------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// Created by Greg Clayton on 6/16/07.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __PThreadCondition_h__
+#define __PThreadCondition_h__
+
+#include <pthread.h>
+
+class PThreadCondition {
+public:
+ PThreadCondition() { ::pthread_cond_init(&m_condition, NULL); }
+
+ ~PThreadCondition() { ::pthread_cond_destroy(&m_condition); }
+
+ pthread_cond_t *Condition() { return &m_condition; }
+
+ int Broadcast() { return ::pthread_cond_broadcast(&m_condition); }
+
+ int Signal() { return ::pthread_cond_signal(&m_condition); }
+
+protected:
+ pthread_cond_t m_condition;
+};
+
+#endif