00001 /* 00002 * This file is part of openMask © INRIA, CNRS, Universite de Rennes 1 1993-2002, thereinafter the Software 00003 * 00004 * The Software has been developped within the Siames Project. 00005 * INRIA, the University of Rennes 1 and CNRS jointly hold intellectual property rights 00006 * 00007 * The Software has been registered with the Agence pour la Protection des 00008 * Programmes (APP) under registration number IDDN.FR.001.510008.00.S.P.2001.000.41200 00009 * 00010 * This file may be distributed under the terms of the Q Public License 00011 * version 1.0 as defined by Trolltech AS of Norway and appearing in the file 00012 * LICENSE.QPL included in the packaging of this file. 00013 * 00014 * Licensees holding valid specific licenses issued by INRIA, CNRS or Université de Rennes 1 00015 * for the software may use this file in accordance with that specific license 00016 * 00017 */ 00018 #include "PsnCondition.h" 00019 00020 #include "PsnMutexLock.h" 00021 #include "PsController.h" 00022 00023 00024 00025 PsnCondition::PsnCondition() { 00026 #ifdef NDEBUG 00027 int ret= 00028 #endif 00029 pthread_cond_init( &_myCondition , NULL ); 00030 #ifdef NDEBUG 00031 if(ret) { 00032 PsController::error("PsnCondition::PsnCondition initialisation failed"); 00033 } 00034 #endif 00035 } 00036 00037 00038 00039 PsnCondition::~PsnCondition() { 00040 pthread_cond_destroy( &_myCondition ); 00041 } 00042 00043 00044 00045 void PsnCondition::signalChange () { 00046 #ifdef _DEBUGLOCK 00047 cerr<<"PsnCondition::signalChange ()"<<endl; 00048 #endif 00049 #ifdef NDEBUG 00050 int ret= 00051 #endif 00052 pthread_cond_signal(&_myCondition); 00053 #ifdef NDEBUG 00054 if(ret) { 00055 PsController::error("PsnCondition::conditionChanged () failed"); 00056 } 00057 #endif 00058 } 00059 00060 00061 00062 void PsnCondition::waitForChange ( PsnMutexLock & associatedLock ) { 00063 #ifdef _DEBUGLOCK 00064 cerr<<"PsnCondition::waitForChange waiting"<<endl; 00065 #endif 00066 #ifdef NDEBUG 00067 int ret= 00068 #endif 00069 pthread_cond_wait(&_myCondition,&associatedLock.mutex); 00070 #ifdef NDEBUG 00071 if(ret) { 00072 PsController::error("PsnCondition::waitForChange failed"); 00073 } 00074 #endif 00075 #ifdef _DEBUGLOCK 00076 cerr<<"PsnCondition::waitForChange change happened"<<endl; 00077 #endif 00078 }
| Documentation generated on Mon Nov 25 15:25:00 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |