Skip to content
Commit 342da7ac authored by Juan Manuel Torres Palma's avatar Juan Manuel Torres Palma Committed by Andrew Boie
Browse files

posix: semaphore: fix bugs and simplify code



Modifies several functions that are causing wrong
behaviour.

 * semaphore.h: add missing restrict keyword.
 * sem_destroy(): check that nobody is waiting
   before destroying the object.
 * sem_timedwait(): simpify function logic and
   fix a bug when abstime > currtime, that passed
   ticks instead of ms to k_sem_take().
 * sem_wait(): avoid unnecessary checks.
 * sem_init(): add pshared value assertion.

Signed-off-by: default avatarJuan Manuel Torres Palma <j.m.torrespalma@gmail.com>
parent 08418a21
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment