00001 /* 00002 * Copyright (C) 2006, Jose Renato Santos. 00003 * 00004 * This file may be distributed under the terms of the Q Public License 00005 * as defined by Trolltech AS of Norway and appearing in the file 00006 * LICENSE.QPL included in the packaging of this file. 00007 * 00008 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING 00009 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00010 * PURPOSE. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 00012 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00013 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00014 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00015 * 00016 */ 00017 00018 /////////////////////////////////////////////////////////////////////////////// 00019 // vsicondition.h: Definition of class that implements VSI condition variable 00020 // (VSI: Virtual System Interface) 00021 /////////////////////////////////////////////////////////////////////////////// 00022 00023 #if !defined __VSICONDITION_H_ 00024 #define __VSICONDITION_H_ 00025 00026 #include <pthread.h> 00027 00028 class CvsiCondition 00029 { 00030 public: 00031 CvsiCondition(); 00032 ~CvsiCondition(); 00033 int IsOpen(); 00034 void Lock(); 00035 void Unlock(); 00036 void Wait(); 00037 void Signal(); 00038 private: 00039 pthread_mutex_t m_Mutex; 00040 pthread_cond_t m_Condition; 00041 int m_isopen; 00042 }; 00043 00044 #endif // __VSICONDITION_H_