Merge branch 'master' of https://github.com/travisg/lk into smp
Change-Id: Iecb11d57b6f089234c0826932bdb229588939750
This commit is contained in:
@@ -32,9 +32,10 @@ void sem_destroy(semaphore_t *sem)
|
||||
THREAD_UNLOCK(state);
|
||||
}
|
||||
|
||||
status_t sem_post(semaphore_t *sem, bool resched)
|
||||
int sem_post(semaphore_t *sem, bool resched)
|
||||
{
|
||||
status_t ret = NO_ERROR;
|
||||
int ret = 0;
|
||||
|
||||
THREAD_LOCK(state);
|
||||
|
||||
/*
|
||||
@@ -42,9 +43,10 @@ status_t sem_post(semaphore_t *sem, bool resched)
|
||||
* it's safe to just increase the count available with no downsides
|
||||
*/
|
||||
if (unlikely(++sem->count <= 0))
|
||||
wait_queue_wake_one(&sem->wait, resched, NO_ERROR);
|
||||
ret = wait_queue_wake_one(&sem->wait, resched, NO_ERROR);
|
||||
|
||||
THREAD_UNLOCK(state);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -95,3 +97,5 @@ status_t sem_timedwait(semaphore_t *sem, lk_time_t timeout)
|
||||
THREAD_UNLOCK(state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* vim: set noexpandtab: */
|
||||
|
||||
Reference in New Issue
Block a user