Update contrib.
1 // Copyright (c) 2006-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 the License "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.
14 // Implements a debug thread for testing.
19 #include <e32base_private.h>
21 #include "d_rmdebugthread.h"
23 EXPORT_C TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
24 extern void RMDebug_BranchTst1();
26 EXPORT_C TInt TestData;
28 CDebugServThread::CDebugServThread()
35 GLDEF_C TInt CDebugServThread::ThreadFunction(TAny*)
37 // Generic thread function for testing
40 CTrapCleanup* cleanup=CTrapCleanup::New();
43 User::Leave(KErrNoMemory);
46 RThread::Rendezvous(KErrNone);
56 // Wait half a second (suspends this thread)
59 if (TestData == 0xFFFFFFFF)
70 EXPORT_C TInt StartDebugThread(RThread& aDebugThread)
72 // Starts the test thread
78 res = aDebugThread.Create( KDebugThreadName,
79 CDebugServThread::ThreadFunction,
81 KDebugThreadDefaultHeapSize,
82 KDebugThreadDefaultHeapSize,
86 // Check that the creation worked
89 TRequestStatus rendezvousStatus;
91 aDebugThread.SetPriority(EPriorityNormal);
92 // Make a request for a rendezvous
93 aDebugThread.Rendezvous(rendezvousStatus);
94 // Set the thread as ready for execution
95 aDebugThread.Resume();
96 // Wait for the resumption
97 User::WaitForRequest(rendezvousStatus);
102 aDebugThread.Close();