Re: Activity timers
- From: "voidcoder" <voidcoder@xxxxxxxxx>
- Date: Mon, 30 May 2005 14:46:10 +0200
Hi. Thanks for reply.
According the same documentation events will be reset
by the power manager itself, so I dont need to touch
them because some other apps/drivers may be watching
for the same events.
>From the doc:
If the time-out associated with the timer expires without a reset event
being signaled, the Power Manager resets the active event and sets the
inactive event
"H. Edgar" <hedgar@xxxxxxxxxxxxxx> wrote in message
news:O4HZMDRZFHA.1088@xxxxxxxxxxxxxxxxxxxxxxx
>
> I am not sure, but according the documentation just one of this events
> will be signaled. This events are manual reset events according the
> documentation too. I think, then calling ResetEvent(Inactive) before
> calling the second Wait would be necessary. ResetEvent(Active) would be
> necessary too after the correpsonding Wait.
>
> Edgar.
>
> "voidcoder" <voidcoder@xxxxxxxxx> wrote in message
> news:OP2k2kQZFHA.2796@xxxxxxxxxxxxxxxxxxxxxxx
>> Could someone pls tell me why the following code does never
>> return from the second WaitForSingleObject call !?
>>
>> HANDLE Active = OpenEvent(EVENT_ALL_ACCESS, FALSE,
>> TEXT("PowerManager/SystemActivity_Active"));
>> HANDLE Inactive = OpenEvent(EVENT_ALL_ACCESS, FALSE,
>> TEXT("PowerManager/SystemActivity_Inactive"));
>>
>> if (WaitForSingleObject(Inactive, INFINITE) == WAIT_OBJECT_0)
>> {
>> if (WaitForSingleObject(Active, INFINITE) == WAIT_OBJECT_0) // <-
>> Stall forever
>> {
>> // Some code
>> }
>> }
>>
>> I'd like to handle Inactive-to-Active transition state using activity
>> timers but do not understand windows behaviour ... I'm able to
>> wait for "Inactive" event, howether it stalls inside the second wait for
>> "Active" event independent from the actual activity on the system.
>> Any ideas?
>>
>> Thanks.
>>
>>
>
>
.
- Follow-Ups:
- Re: Activity timers
- From: H. Edgar
- Re: Activity timers
- References:
- Activity timers
- From: voidcoder
- Re: Activity timers
- From: H. Edgar
- Activity timers
- Prev by Date: Re: Activity timers
- Next by Date: Re: Migrating Windows CE.NET 4.2 to CE 5.0 on OMAP1510 platform
- Previous by thread: Re: Activity timers
- Next by thread: Re: Activity timers
- Index(es):
Relevant Pages
|
|