![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
00001 /******************************************************************************** 00002 * * 00003 * B a r r i e r C l a s s * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2004,2012 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU Lesser General Public License as published by * 00010 * the Free Software Foundation; either version 3 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public License * 00019 * along with this program. If not, see <http://www.gnu.org/licenses/> * 00020 ********************************************************************************/ 00021 #ifndef FXBARRIER_H 00022 #define FXBARRIER_H 00023 00024 namespace FX { 00025 00026 00030 class FXAPI FXBarrier { 00031 private: 00032 FXCondition condition; 00033 FXMutex mutex; 00034 FXuint generation; 00035 FXuint threshold; 00036 FXuint counter; 00037 private: 00038 FXBarrier(const FXBarrier&); 00039 FXBarrier &operator=(const FXBarrier&); 00040 public: 00041 00043 FXBarrier(FXuint count=1); 00044 00046 FXbool wait(); 00047 00049 ~FXBarrier(); 00050 }; 00051 00052 00053 } 00054 00055 #endif 00056
|
|