1 /* |
1 /* |
2 * Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-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". |
35 // ----------------------------------------------------------------------------- |
36 // ----------------------------------------------------------------------------- |
36 // |
37 // |
37 static void RunServerL() |
38 static void RunServerL() |
38 { |
39 { |
39 MPMLOGSTRING( "MPMStarter::RunServerL" ) |
40 MPMLOGSTRING( "MPMStarter::RunServerL" ) |
40 // create and install the active scheduler we need |
41 // Create and install the active scheduler |
41 CActiveScheduler* s=new( ELeave ) CActiveScheduler; |
42 CMpmScheduler* scheduler = CMpmScheduler::NewLC(); |
42 CleanupStack::PushL( s ); |
43 CActiveScheduler::Install( scheduler ); |
43 CActiveScheduler::Install( s ); |
44 |
44 // |
45 // Create the server |
45 // create the server |
|
46 CServer2* server = MPMStarter::CreateAndStartServerL(); |
46 CServer2* server = MPMStarter::CreateAndStartServerL(); |
47 CleanupStack::PushL( server ); |
47 CleanupStack::PushL( server ); |
|
48 scheduler->SetMpmServer( server ); |
48 |
49 |
49 User::LeaveIfError( RThread::RenameMe( MPMStarter::ServerName() ) ); |
50 User::LeaveIfError( RThread::RenameMe( MPMStarter::ServerName() ) ); |
50 |
51 |
51 // Initialisation complete, now signal the client |
52 // Initialisation complete, now signal the client |
52 RProcess::Rendezvous( KErrNone ); |
53 RProcess::Rendezvous( KErrNone ); |
53 |
54 |
54 // Ready to run |
55 // Ready to run |
55 CActiveScheduler::Start(); |
56 CActiveScheduler::Start(); |
56 // |
57 |
57 // Cleanup the server and scheduler |
58 // Cleanup the server and scheduler |
58 CleanupStack::PopAndDestroy( server ); |
59 CleanupStack::PopAndDestroy( server ); |
59 CleanupStack::PopAndDestroy( s ); |
60 CleanupStack::PopAndDestroy( scheduler ); |
60 } |
61 } |
61 |
62 |
62 |
63 |
63 // ----------------------------------------------------------------------------- |
64 // ----------------------------------------------------------------------------- |
64 // Server process entry-point |
65 // Server process entry-point |