00001 // vim:set et sts=4 ts=4 tw=75 sw=4 ai ci cin cino=g0,t0: 00002 /* 00003 * Copyright (C) 2007, Technical Computer Science Group, 00004 * University of Bonn 00005 * 00006 * This file is part of the ReChannel library. 00007 * 00008 * The ReChannel library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as 00010 * published by the Free Software Foundation; either version 2 of the 00011 * License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be 00014 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this library; see the file COPYING. If not, write to the 00020 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 00021 * Boston, MA 02110-1301, USA. 00022 * 00023 * Authors: Andreas Raabe and Armin Felke. Implementation by Armin Felke. 00024 * {raabe, felke}@cs.uni-bonn.de 00025 */ 00037 #include "rc_join.h" 00038 00039 namespace ReChannel { 00040 00041 rc_join::rc_join() 00042 { } 00043 00044 void rc_join::wait() 00045 { 00046 if (p_hproc_vector.size() > 0) { 00047 if (p_hproc_vector.size() == 1) { 00048 rc_wait((*p_hproc_vector.begin()).terminated_event()); 00049 } else { // p_hproc_vector.size() >= 2 00050 sc_event_and_list& event_and_list = 00051 (*p_hproc_vector.begin()).terminated_event() 00052 & (*(++p_hproc_vector.begin())).terminated_event(); 00053 hproc_vector::iterator it; 00054 for (it = p_hproc_vector.begin() + 2; 00055 it != p_hproc_vector.end(); 00056 ++it) 00057 { 00058 event_and_list & (*it).terminated_event(); 00059 } 00060 rc_wait(event_and_list); 00061 } 00062 } 00063 } 00064 00065 } // namespace ReChannel 00066 00067 // 00068 // $Id: rc_join.cpp,v 1.4 2007/10/09 00:22:26 felke Exp $ 00069 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/components/rc_join.cpp,v $ 00070 // 00071