00001 /*************************************************************************** 00002 * Copyright (C) 2005-2007 Stefan Schwarzer, Jens Schneider, * 00003 * Matthias Hardt, Guido Madaus * 00004 * * 00005 * Copyright (C) 2007-2008 BerLinux Solutions GbR * 00006 * Stefan Schwarzer & Guido Madaus * 00007 * * 00008 * Copyright (C) 2009-2013 BerLinux Solutions GmbH * 00009 * * 00010 * Authors: * 00011 * Stefan Schwarzer <stefan.schwarzer@diskohq.org>, * 00012 * Matthias Hardt <matthias.hardt@diskohq.org>, * 00013 * Jens Schneider <jens.schneider@diskohq.org>, * 00014 * Guido Madaus <guido.madaus@diskohq.org>, * 00015 * Patrick Helterhoff <patrick.helterhoff@diskohq.org>, * 00016 * René Bählkow <rene.baehlkow@diskohq.org> * 00017 * * 00018 * This library is free software; you can redistribute it and/or * 00019 * modify it under the terms of the GNU Lesser General Public * 00020 * License version 2.1 as published by the Free Software Foundation. * 00021 * * 00022 * This library is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00025 * Lesser General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU Lesser General Public * 00028 * License along with this library; if not, write to the * 00029 * Free Software Foundation, Inc., * 00030 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * 00031 **************************************************************************/ 00032 00033 #ifndef MMSFLASHTHREAD_H_ 00034 #define MMSFLASHTHREAD_H_ 00035 00036 #ifndef _NO_MMSFLASH 00037 00038 #include "mms.h" 00039 #include "mmsflash/mmsflash.h" 00040 00041 typedef enum { 00042 MMSFLASHTHREAD_MODE_LOADER = 0, 00043 MMSFLASHTHREAD_MODE_PLAYER = 1 00044 } MMSFLASHTHREAD_MODE; 00045 00046 class MMSFlashThread : public MMSThread { 00047 private: 00048 //! access to the flash object 00049 MMSFlash *flash; 00050 00051 //! mode of the thread 00052 MMSFLASHTHREAD_MODE mode; 00053 00054 //! start flag, means that the thread was started after start(), but it can be finished 00055 bool started; 00056 00057 //! stop flag 00058 bool stop; 00059 00060 //! main routine 00061 void threadMain(); 00062 public: 00063 MMSFlashThread(MMSFlash *flash, MMSFLASHTHREAD_MODE mode, string identity = "MMSFlashThread"); 00064 00065 //! start the thread 00066 bool start(); 00067 00068 //! is the thread started 00069 bool isStarted(void); 00070 00071 //! thread should stop 00072 void invokeStop(void); 00073 00074 //! waiting until end of the thread 00075 void waitUntilStopped(void); 00076 }; 00077 00078 #endif /* _NO_MMSFLASH */ 00079 00080 #endif /*MMSFLASHTHREAD_H_*/