os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfDevSoundServerStart.cpp
Update contrib.
1 // Copyright (c) 2004-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 #include <ecom/ecom.h>
18 #include "MmfDevSoundServer.h"
21 EXPORT_C TInt CMMFDevSoundServer::StartThread(TAny* aParms)
23 Thread entry-point function.
24 The TServerStart objects is passed as the thread parameter
28 #ifdef SYMBIAN_USE_SEPARATE_HEAPS
31 TDevSoundServerStart* start = reinterpret_cast<TDevSoundServerStart*>(aParms);
32 CTrapCleanup* cleanup = CTrapCleanup::New();
39 TRAP(err, StartThreadL(*start));
43 REComSession::FinalClose();
44 #ifdef SYMBIAN_USE_SEPARATE_HEAPS
50 void CMMFDevSoundServer::StartThreadL(TDevSoundServerStart& aStart)
52 CActiveScheduler* sched = new(ELeave) CActiveScheduler;
53 CleanupStack::PushL(sched);
55 CActiveScheduler::Install(sched);
56 CMMFDevSoundServer* server = CMMFDevSoundServer::NewL(aStart.iAudioServer, aStart.iProcessId);
57 CleanupStack::PushL(server);
59 //Rename and set the priority of devsound server
60 RenamePrioritizeServer();
62 aStart.iDevSoundServerHandle = server->Server();
63 // Sync with the client and enter the active scheduler
64 RThread::Rendezvous(KErrNone);
67 CleanupStack::PopAndDestroy(2, sched); // sched, server