commsfwutils/commsbufs/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 #include <comms-infras/commsbufpond.h>
       
    22 
       
    23 namespace CommsFW {
       
    24 
       
    25 class MCommsBufManagerIntf;
       
    26 
       
    27 class RCFThread : public RThread
       
    28 /** Utility class to control the creation of a new thread.  Implements it's own
       
    29 main thread function in order to process the startup correctly. Used
       
    30 to make sure that e.g. the MBufMgr TLS is transferred properly to the new thread, 
       
    31 thus enabling it to use the process shared MBuf Manager.
       
    32 @internalTechnology 
       
    33 @released
       
    34 */
       
    35 	{
       
    36 public:
       
    37 
       
    38 	IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aThreadFunction,
       
    39 		TInt aStackSize, RHeap* aHeap, TAny* aArg);				
       
    40 	IMPORT_C TInt Create(const TDesC& aName, TThreadFunction aThreadFunction, TInt aStackSize,
       
    41 		TInt aMinHeapSize, TInt aMaxHeapSize, TAny* aArg);
       
    42 
       
    43 private:	
       
    44 	static TInt RCFThreadFunction(TAny* aStartupInfo);
       
    45 
       
    46 private:
       
    47 	struct ThreadStartupInfo
       
    48 		{
       
    49 		RCommsBufPond iCommsBufPond;
       
    50 		__CFLOG_STMT(CCFLogIf* iCFLogIf;)
       
    51 		TThreadFunction iOtherThreadFunction;
       
    52 		TAny* iModuleArgs;
       
    53 		} iStartupInfo;
       
    54 	};
       
    55 
       
    56 
       
    57 
       
    58 } // namespace CommsFW
       
    59 
       
    60 #endif // __CFTHREAD_H__
       
    61