1 //===-- PThreadCondition.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Created by Greg Clayton on 6/16/07.
12 //===----------------------------------------------------------------------===//
14 #ifndef __PThreadCondition_h__
15 #define __PThreadCondition_h__
19 class PThreadCondition {
21 PThreadCondition() { ::pthread_cond_init(&m_condition, NULL); }
23 ~PThreadCondition() { ::pthread_cond_destroy(&m_condition); }
25 pthread_cond_t *Condition() { return &m_condition; }
27 int Broadcast() { return ::pthread_cond_broadcast(&m_condition); }
29 int Signal() { return ::pthread_cond_signal(&m_condition); }
32 pthread_cond_t m_condition;