Skip to content
Snippets Groups Projects
Commit c8ddcea2 authored by Thierno souleymane Bah's avatar Thierno souleymane Bah
Browse files

fix(sem_down function edited, counter now decremented)

parent 47ad6fa4
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ void sem_down(sem_t *sem) ...@@ -33,7 +33,7 @@ void sem_down(sem_t *sem)
assert(sem->magic == SEM_MAGIC); assert(sem->magic == SEM_MAGIC);
irq_disable(); irq_disable();
if ((++sem->cpt) < 0) if ((--sem->cpt) < 0)
{ {
current_ctx->status = CTX_WAIT; current_ctx->status = CTX_WAIT;
current_ctx->sem_next_ctx = sem->first_ctx; current_ctx->sem_next_ctx = sem->first_ctx;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment