examples/Base/SemaphoreExample/inc/SemaphoreExample.h

00001 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 // Contains the definition of the CSemaphoreExample class.
00015 //
00016 
00017 
00018 #ifndef CSEMAPHOREEXAMPLE_H_
00019 #define CSEMAPHOREEXAMPLE_H_
00020 
00021 #include "CDatabase.h"
00022 
00027 class CSemaphoreExample : public CBase
00028     {
00029 public:
00030     virtual ~CSemaphoreExample();  
00031     static CSemaphoreExample* NewL();
00032     
00033     static TInt ReadThreadFuncL(TAny* aPtr);
00034 
00035     static TInt WriteThreadFuncL(TAny* aPtr);
00036     
00037     void StartThreads(); 
00038     
00039     void PrintMessage(); 
00040  
00041 protected: 
00042     void ConstructL();
00043         
00044 private: 
00045     //Thread to read data from database.
00046     RThread iReadThread;
00047     //Thread to write data in the database.
00048     RThread iWriteThread;
00049     
00050     CConsoleBase* iConsole; 
00051     
00052     #ifdef USE_SEMAPHORE
00053     RSemaphore iSem; 
00054     #endif
00055     };
00056 
00057 #endif /*CSEMPAHOREEXAMPLE_H_*/

Generated by  doxygen 1.6.2