os/graphics/graphicsresourceservices/graphicsresourceimplementation/test/src/tsggenericmanualsecondprocess.cpp
Update contrib.
1 // Copyright (c) 2010 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.
16 #include <e32msgqueue.h>
17 #include <sgresource/sgimage.h>
18 #include "tgraphicsresourcemultiprocessthread.h"
20 // The second process waits for image IDs sent by the main test process
21 // and opens and closes RSgImage handles to the corresponding images.
22 // Image IDs are received through a message queue and synchronisation
23 // with the main process is achieved by means of rendezvous objects.
24 // A null ID indicates the end of the test.
28 User::LeaveIfError(driver.Open());
29 CleanupClosePushL(driver);
30 RMsgQueue<TSgDrawableId> msgQ;
31 User::LeaveIfError(msgQ.OpenGlobal(KSgTestMultiprocessMsgQ));
32 CleanupClosePushL(msgQ);
36 msgQ.ReceiveBlocking(id);
37 if (id == KSgNullDrawableId)
42 TInt err = image.Open(id);
44 RProcess::Rendezvous(err);
46 CleanupStack::PopAndDestroy(2);
49 GLDEF_C TInt E32Main()
52 CTrapCleanup* cleanup = CTrapCleanup::New();