Re: Activity timers
- From: "H. Edgar" <hedgar@xxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 15:29:02 +0200
hmm... may be. Then without reset, the Powermanager is setting the inactive
event and resetting the active event. But it is true the converse way.
Without reseting the inactive event the active event will not be signaled.
But I still do not test it.
"voidcoder" <voidcoder@xxxxxxxxx> wrote in message
news:e8EXPWRZFHA.2796@xxxxxxxxxxxxxxxxxxxxxxx
> 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.
>>>
>>>
>>
>>
>
>
.
- References:
- Activity timers
- From: voidcoder
- Re: Activity timers
- From: H. Edgar
- Re: Activity timers
- From: voidcoder
- Activity timers
- Prev by Date: Re: Display problem
- Next by Date: Re: Audio problem in VOIP application
- Previous by thread: Re: Activity timers
- Index(es):
Relevant Pages
|
|