|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "clockthreadnotifier.h" |
|
20 |
|
21 _LIT(KClockThreadPanicMsg, "CLOCK-THREAD-NOTIFIER"); |
|
22 |
|
23 CClockThreadNotifier* CClockThreadNotifier::NewL(CClockSupervisor* aClockSupervisor) |
|
24 { |
|
25 CClockThreadNotifier* self = new(ELeave)CClockThreadNotifier(aClockSupervisor); |
|
26 CleanupStack::PushL(self); |
|
27 self->ConstructL(); |
|
28 CleanupStack::Pop(self); |
|
29 return self; |
|
30 } |
|
31 |
|
32 CClockThreadNotifier::CClockThreadNotifier(CClockSupervisor* aClockSupervisor):CActive(CActive::EPriorityStandard) |
|
33 { |
|
34 iClockSupervisor = aClockSupervisor; |
|
35 } |
|
36 void CClockThreadNotifier::ConstructL() |
|
37 { |
|
38 CActiveScheduler::Add(this); |
|
39 } |
|
40 void CClockThreadNotifier::RunL() |
|
41 { |
|
42 |
|
43 iClockSupervisor->ReportClockThreadPanic(); |
|
44 |
|
45 } |
|
46 void CClockThreadNotifier::DoCancel() |
|
47 { |
|
48 // Do Nothing |
|
49 } |
|
50 CClockThreadNotifier::~CClockThreadNotifier() |
|
51 { |
|
52 Cancel(); |
|
53 } |
|
54 TInt CClockThreadNotifier::RunError(TInt) |
|
55 { |
|
56 return KErrNone; |
|
57 } |
|
58 void CClockThreadNotifier::IssueRequest() |
|
59 { |
|
60 __ASSERT_ALWAYS(!IsActive(), User::Panic(KClockThreadPanicMsg, 0)); |
|
61 iClockSupervisor->iThread.Logon(iStatus); |
|
62 SetActive(); |
|
63 } |