commsfwutils/commsbufs/version1/mbufmgr/INC/mb_thread.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __MB_THREAD_H__
       
    17 #define __MB_THREAD_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <cflog.h>
       
    21 
       
    22 class CMBufManager;
       
    23 namespace CommsFW {
       
    24 
       
    25 
       
    26 class RCFThread : public RThread
       
    27 /** Utility class to control the creation of a new thread.  Implements it's own
       
    28 main thread function in order to process the startup correctly. Used
       
    29 to make sure that e.g. the MBufMgr TLS is transferred properly to the new thread, 
       
    30 thus enabling it to use the process shared MBuf Manager.
       
    31 @internalTechnology 
       
    32 @released
       
    33 */
       
    34 	{
       
    35 public:
       
    36 
       
    37 	IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aThreadFunction,
       
    38 		TInt aStackSize, RHeap* aHeap, TAny* aArg);				
       
    39 	IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aThreadFunction, TInt aStackSize,
       
    40 		TInt aMinHeapSize, TInt aMaxHeapSize, TAny* aArg);
       
    41 
       
    42 private:	
       
    43 	static TInt RCFThreadFunction(TAny* aStartupInfo);
       
    44 
       
    45 private:
       
    46 	struct ThreadStartupInfo
       
    47 		{
       
    48 		CMBufManager* iMBufManager;
       
    49 		__CFLOG_STMT(CCFLogIf* iCFLogIf;)
       
    50 		TThreadFunction iOtherThreadFunction;
       
    51 		TAny* iModuleArgs;
       
    52 		} iStartupInfo;
       
    53 	};
       
    54 
       
    55 
       
    56 
       
    57 } // namespace CommsFW
       
    58 
       
    59 #endif // __CFTHREAD_H__
       
    60