tzservices/tzserver/Server/Source/MAIN.CPP
changeset 81 676b6116ca93
parent 0 2e3d3ce01487
equal deleted inserted replaced
78:175a0d824084 81:676b6116ca93
     1 
     1 
     2 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 // All rights reserved.
     3 // All rights reserved.
     4 // This component and the accompanying materials are made available
     4 // This component and the accompanying materials are made available
     5 // under the terms of "Eclipse Public License v1.0"
     5 // under the terms of "Eclipse Public License v1.0"
     6 // which accompanies this distribution, and is available
     6 // which accompanies this distribution, and is available
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 // Description:
    14 // Description:
    15 //
    15 //
    16 
    16 
    17 #include "timezoneserver.h"
    17 #include "timezoneserver.h"
    18 #include <s32file.h>
    18 #include <s32file.h>
       
    19 #include "OstTraceDefinitions.h"
       
    20 #ifdef OST_TRACE_COMPILER_IN_USE
       
    21 #include "MAINTraces.h"
       
    22 #endif
       
    23 
    19 
    24 
    20 CTZSrvScheduler::~CTZSrvScheduler()
    25 CTZSrvScheduler::~CTZSrvScheduler()
    21 	{
    26 	{
    22 	delete iServer;
    27 	delete iServer;
    23 	}
    28 	}
    45 	//
    50 	//
    46 	// Thread top level
    51 	// Thread top level
    47 	// Perform all server initialisation, in particular creation of the
    52 	// Perform all server initialisation, in particular creation of the
    48 	// scheduler and server and then run the scheduler
    53 	// scheduler and server and then run the scheduler
    49 	//
    54 	//
    50 	{
    55 	{ 
       
    56     OstTraceDef0( OST_TRACE_CATEGORY_DEBUG,TRACE_FLOW_PARAM, _RUNSERVERL, "::RunServerL Entry" );
       
    57     
       
    58     
    51 	// create and install the active scheduler we need
    59 	// create and install the active scheduler we need
    52 	CTZSrvScheduler* s = CTZSrvScheduler::NewL();
    60 	CTZSrvScheduler* s = CTZSrvScheduler::NewL();
    53 	CleanupStack::PushL(s);
    61 	CleanupStack::PushL(s);
    54 
    62 
    55 	//
    63 	//
    64 	// Ready to run
    72 	// Ready to run
    65 	CActiveScheduler::Start();
    73 	CActiveScheduler::Start();
    66 	//
    74 	//
    67 	// Cleanup the scheduler
    75 	// Cleanup the scheduler
    68 	CleanupStack::PopAndDestroy(s);
    76 	CleanupStack::PopAndDestroy(s);
       
    77 	OstTraceDef0( OST_TRACE_CATEGORY_DEBUG,TRACE_FLOW_PARAM, __RUNSERVERL_EXIT, "::RunServerL Exit" );
       
    78 	
    69 	}
    79 	}
    70 
    80 
    71 GLDEF_C TInt E32Main()
    81 GLDEF_C TInt E32Main()
    72 //
    82 //
    73 // Timezone server entrypoint
    83 // Timezone server entrypoint
    74 //
    84 //
    75 	{
    85 	{     
       
    86   OstTraceDef0( OST_TRACE_CATEGORY_DEBUG,TRACE_FLOW_PARAM, _E32MAIN_ENTRY, "::E32Main Entry" );
       
    87   
       
    88             
    76 	__UHEAP_MARK;
    89 	__UHEAP_MARK;
    77 	//
    90 	//
    78 	CTrapCleanup* cleanup = CTrapCleanup::New();
    91 	CTrapCleanup* cleanup = CTrapCleanup::New();
    79 	TInt r = KErrNoMemory;
    92 	TInt r = KErrNoMemory;
    80 	if (cleanup)
    93 	if (cleanup)
    82 		TRAP(r, RunServerL());
    95 		TRAP(r, RunServerL());
    83 		delete cleanup;
    96 		delete cleanup;
    84 		}
    97 		}
    85 	//
    98 	//
    86 	__UHEAP_MARKEND;
    99 	__UHEAP_MARKEND;
       
   100 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, _E32MAIN_EXIT, "::E32Main Exit ;return value=%u", r );
       
   101 	
    87 	return r;
   102 	return r;
    88 	}
   103 	}