[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/5] libacpica: Add acpi_init
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 3/5] libacpica: Add acpi_init |
Date: |
Sat, 3 Apr 2021 15:09:47 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Damien Zammit, le dim. 04 avril 2021 00:00:56 +1100, a ecrit:
> >> +acpi_status
> >> +acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout)
> >> +{
> >> + int i;
> >> +
> >> + if (!timeout)
> >> + timeout = 1;
> >> +
> >> + for (i = 0; i < timeout; i++) {
> >> + if (!sem_trywait(handle)) {
> >> + return AE_OK;
> >
> > Is timeout really expected to be the number of *times* to try to take
> > the semaphore? Isn't it rather a time value that you can rather pass to
> > sem_timedwait?
>
> It was a cheap way to wait, yes, I cheated. Because sem_timedwait
> expects an epoch and I didn't have time to implement it properly yet.
Then introduce a usleep() in the loop to actually wait for the given
time, otherwise you may get spurious timeouts.
Samuel
[PATCH 2/5] libacpica: Add config for GNU, Damien Zammit, 2021/04/03
[PATCH 5/5] acpi: Add new RPCs, Damien Zammit, 2021/04/03
[PATCH 4/5] acpi: Add acpi_init to server to initialize ACPI, Damien Zammit, 2021/04/03