Merge branch 'master' of https://github.com/travisg/lk into smp

Change-Id: Iecb11d57b6f089234c0826932bdb229588939750
This commit is contained in:
Arve Hjønnevåg
2015-05-18 16:49:37 -07:00
115 changed files with 6371 additions and 1075 deletions

View File

@@ -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: */