00001 /* 00002 00003 Condition class, header 00004 Copyright (C) 1999-2000 Jussi Laako 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 00020 */ 00021 00022 00023 #include <pth.h> 00024 00025 00026 #ifndef PTHCOND_HH 00027 #define PTHCOND_HH 00028 00029 class clPthCond 00030 { 00031 pth_cond_t pthcCond; 00032 public: 00033 clPthCond() { pth_cond_init(&pthcCond); } 00034 ~clPthCond() {} 00035 void Wait(pth_mutex_t *pthmCond) 00036 { pth_cond_await(&pthcCond, pthmCond, NULL); } 00037 void Wait(pth_mutex_t *pthmCond, pth_event_t ptheCond) 00038 { pth_cond_await(&pthcCond, pthmCond, ptheCond); } 00039 void Notify(int iNotifyAll) 00040 { pth_cond_notify(&pthcCond, iNotifyAll); } 00041 }; 00042 00043 #endif 00044