Update contrib.
1 // Copyright (c) 1998-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 // e32test\power\async.h
18 class RAsyncSwitchOff : public RThread
21 TInt Start(TTimeIntervalMicroSeconds32 aTime);
23 static TInt Thread(TAny* aPtr);
25 TTimeIntervalMicroSeconds32 iTime;
26 TRequestStatus iStatus;
29 _LIT(KAsyncSwitchOffThreadName, "AsyncSwitchOffThread");
31 TInt RAsyncSwitchOff::Thread(TAny* aPtr)
33 RAsyncSwitchOff& a=*(RAsyncSwitchOff*)aPtr;
39 TInt RAsyncSwitchOff::Start(TTimeIntervalMicroSeconds32 aTime)
42 TInt r=Create(KAsyncSwitchOffThreadName, Thread, 0x1000, NULL, this);
45 SetPriority(EPriorityMuchMore);
51 TInt RAsyncSwitchOff::Wait()
53 User::WaitForRequest(iStatus);
54 TExitType exitType=ExitType();
55 CLOSE_AND_WAIT(*this);
56 if (exitType!=EExitKill)
57 User::Panic(_L("AsyncSwitchOff"), iStatus.Int());