diff options
author | 2020-08-03 14:33:06 +0000 | |
---|---|---|
committer | 2020-08-03 14:33:06 +0000 | |
commit | 061da546b983eb767bad15e67af1174fb0bcf31c (patch) | |
tree | 83c78b820819d70aa40c36d90447978b300078c5 /gnu/llvm/lldb/tools/debugserver/source/PThreadCondition.h | |
parent | Import LLVM 10.0.0 release including clang, lld and lldb. (diff) | |
download | wireguard-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.h | 34 |
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 |