00001 /*-------------------------------------------------------------------- 00002 * 00003 * (C) Copyright Koninklijke Philips Electronics NV 2006. 00004 * All rights reserved. This software is licensed under the terms of 00005 * version 2.1 of the GNU Lesser General Public License as published 00006 * by the Free Software Foundation. For licensing and warranty 00007 * information, see the file COPYING in the main directory. 00008 * 00009 *------------------------------------------------------------------*/ 00010 00011 #ifndef COSYPROCESS_H 00012 #define COSYPROCESS_H 00013 00014 #include "rte.h" 00015 #include "rteprocess.h" 00016 #include "count.h" 00017 #ifdef PREEMPTIVE 00018 #include "mutexapi.h" 00019 #endif 00020 00021 class Task; 00022 00023 class cosyProcess : public rteProcess 00024 { 00025 public: 00026 cosyProcess(ProcessImpl&, cosyRte& r); 00027 ~cosyProcess(); 00028 00029 void start(); 00030 void execute(const char* i); 00031 00032 void join(); 00033 void kill(); 00034 void exit(); 00035 00036 bool finished() const; 00037 00038 private: 00039 Task* task; 00040 bool run; 00041 Counters cntr; 00042 friend class cosyNetwork; 00043 cosyRte* rte; 00044 00045 #ifdef PREEMPTIVE 00046 Mutex mutex; 00047 void lock(); 00048 void unlock(); 00049 #endif 00050 }; 00051 00052 #endif