00001 /* --------------------------------------------------------------------------- 00002 Phission : 00003 Realtime Vision Processing System 00004 00005 Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu) 00006 University of Massachusetts at Lowell, 00007 Laboratory for Artificial Intelligence and Robotics 00008 00009 This file is part of Phission. 00010 00011 Phission is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU Lesser General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 Phission is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU Lesser General Public License for more details. 00020 00021 You should have received a copy of the GNU Lesser General Public License 00022 along with Phission; if not, write to the Free Software 00023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 00025 ---------------------------------------------------------------------------*/ 00026 #ifndef _PHCONDITION_H 00027 #define _PHCONDITION_H 00028 00029 #include <phStandard.h> 00030 #include <phMutex.h> 00031 00037 /* ------------------------------------------------------------------------- */ 00043 #define phCondition_RECEIVED phSUCCESS 00044 00049 #define phCondition_NOTRECEIVED 1 00050 00051 /* ------------------------------------------------------------------------- */ 00056 typedef struct ph_condition_info_t *ph_condition_info; 00057 00058 /* ------------------------------------------------------------------------- */ 00073 PHAPI(class) phCondition : public phMutex 00074 { 00075 protected: 00080 ph_condition_info m_info; 00081 #if defined(WIN32) 00082 00083 phMutex m_info_lock; 00084 #endif 00085 00086 public: 00091 phCondition(); 00096 virtual ~phCondition(); 00097 00098 /* -------------------------------------------------------------------- */ 00112 int broadcast(); 00113 00114 /* -------------------------------------------------------------------- */ 00129 int signal(); 00130 00131 /* -------------------------------------------------------------------- */ 00149 int timedWait( const int sec,const int nsec ); 00150 00151 /* -------------------------------------------------------------------- */ 00167 int signalWait(); 00168 }; 00169 /* end \addtogroup ThreadSync */ 00171 00172 00173 #endif /* _PHCONDITION_H */
Copyright (C) 2002 - 2007 |
Philip D.S. Thoren ( pthoren@users.sourceforge.net ) University Of Massachusetts at Lowell Robotics Lab |