URL
https://opencores.org/ocsvn/mlite/mlite/trunk
[/] [mlite/] [trunk/] [kernel/] [rtos.c] - Diff between revs 138 and 146
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 138 |
Rev 146 |
Line 649... |
Line 649... |
|
|
/******************************************/
|
/******************************************/
|
void OS_SemaphorePost(OS_Semaphore_t *Semaphore)
|
void OS_SemaphorePost(OS_Semaphore_t *Semaphore)
|
{
|
{
|
uint32 state;
|
uint32 state;
|
OS_Thread_t *thread=NULL;
|
OS_Thread_t *thread;
|
|
|
assert(Semaphore);
|
assert(Semaphore);
|
state = OS_CriticalBegin();
|
state = OS_CriticalBegin();
|
if(++Semaphore->count <= 0)
|
if(++Semaphore->count <= 0)
|
{
|
{
|
Line 661... |
Line 661... |
OS_ThreadTimeoutRemove(thread);
|
OS_ThreadTimeoutRemove(thread);
|
OS_ThreadPriorityRemove(&Semaphore->threadHead, thread);
|
OS_ThreadPriorityRemove(&Semaphore->threadHead, thread);
|
OS_ThreadPriorityInsert(&ThreadHead, thread);
|
OS_ThreadPriorityInsert(&ThreadHead, thread);
|
thread->semaphorePending = NULL;
|
thread->semaphorePending = NULL;
|
thread->returnCode = 0;
|
thread->returnCode = 0;
|
}
|
|
if(thread)
|
|
OS_ThreadReschedule(0);
|
OS_ThreadReschedule(0);
|
|
}
|
OS_CriticalEnd(state);
|
OS_CriticalEnd(state);
|
}
|
}
|
|
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.