dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Classic holdswitch polling

Re: Classic holdswitch polling

From: Thomas Martitz <>
Date: Sat, 10 Mar 2012 22:53:45 +0100

Am 10.03.2012 22:37, schrieb Michael Sevakis:
>>> The least invasive way to fix this bug would probably be to figure out
>>> if I2C is already in use when trying to read the hold switch in the
>>> tick
>>> task, and if it is just skip updating the hold switch status for
>>> that tick.
>> Really a nice hack, just one line of code to check if the mutex is
>> locked.
> No, don't look at mutexes like that since I make no promise to not
> break code peeking under their skirt. I'll write you up a
> mutex_lock_w_tmo if you really must have it. Semaphore have no
> priority inheritance so I wouldn't use those either because you _will_
> notice when priority inversions happen (and it's not nice).

pthread has mutex_trylock() for this case. Maybe worth having it too?

Best regards.
Received on 2012-03-10

Page was last modified "Jan 10 2012" The Rockbox Crew