cvra / platform-abstraction

Platform abstraction layer for microcontrollers
3 stars 6 forks source link

Non blocking semaphores / mutex #11

Closed antoinealb closed 10 years ago

antoinealb commented 10 years ago

We should perhaps implement a non blocking version of os_semaphore_take and os_mutex_take which would simply do an atomic test-and-set and return if the operation suceeded or not.

froj commented 10 years ago

Yes. And also blocking with timeout.

antoinealb commented 10 years ago

+1 for blocking with timeout. Now for the timeout format : float in seconds ? int in milliseconds ? int in microseconds ?

froj commented 10 years ago

I like seconds because SI, but milli- or microseconds would probably be more readable.

antoinealb commented 10 years ago

I think we can agree that this is low-level enough to allow non-SI units, but not weird non-physical units like processor ticks or whatever.

froj commented 10 years ago

not weird non-physical units like processor ticks or whatever

+1

pierluca commented 10 years ago

+1 (favoring float milliseconds or uint32 microseconds)

On Fri, Jun 13, 2014 at 12:53 AM, froj notifications@github.com wrote:

not* weird non-physical units like processor ticks or whatever

+1

— Reply to this email directly or view it on GitHub https://github.com/cvra/platform-abstraction/issues/11#issuecomment-45958106 .

antoinealb commented 10 years ago

Fixed in PR #17 .