remove rt_ipc_object_decrease function
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@322 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
bbd9f470f0
commit
b557f30630
38
src/ipc.c
38
src/ipc.c
|
@ -30,6 +30,7 @@
|
|||
* re-calculated delta tick is a negative number.
|
||||
* 2009-12-16 Bernard fix the rt_ipc_object_suspend issue when IPC flag
|
||||
* is RT_IPC_FLAG_PRIO
|
||||
* 2010-01-20 mbbill remove rt_ipc_object_decrease function.
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
@ -170,7 +171,7 @@ rt_inline rt_err_t rt_ipc_object_resume_all(struct rt_ipc_object* ipc)
|
|||
* In rt_thread_resume function, it will remove current thread from
|
||||
* suspend list
|
||||
*/
|
||||
rt_thread_resume(thread);
|
||||
rt_thread_resume(thread);
|
||||
|
||||
/* enable interrupt */
|
||||
rt_hw_interrupt_enable(temp);
|
||||
|
@ -179,17 +180,6 @@ rt_inline rt_err_t rt_ipc_object_resume_all(struct rt_ipc_object* ipc)
|
|||
return RT_EOK;
|
||||
}
|
||||
|
||||
/* decrease ipc suspended thread number when thread can not take resource successfully */
|
||||
rt_inline void rt_ipc_object_decrease(struct rt_ipc_object* ipc)
|
||||
{
|
||||
register rt_ubase_t level;
|
||||
|
||||
/* disable interrupt */
|
||||
level = rt_hw_interrupt_disable();
|
||||
|
||||
/* enable interrupt */
|
||||
rt_hw_interrupt_enable(level);
|
||||
}
|
||||
#ifdef RT_USING_SEMAPHORE
|
||||
|
||||
/**
|
||||
|
@ -377,8 +367,6 @@ rt_err_t rt_sem_take (rt_sem_t sem, rt_int32_t time)
|
|||
|
||||
if (thread->error != RT_EOK)
|
||||
{
|
||||
/* decrease suspended thread count */
|
||||
rt_ipc_object_decrease(&(sem->parent));
|
||||
return thread->error;
|
||||
}
|
||||
}
|
||||
|
@ -677,9 +665,6 @@ rt_err_t rt_mutex_take (rt_mutex_t mutex, rt_int32_t time)
|
|||
|
||||
if (thread->error != RT_EOK)
|
||||
{
|
||||
/* decrease suspended thread count */
|
||||
rt_ipc_object_decrease(&(mutex->parent));
|
||||
|
||||
/* return error */
|
||||
return thread->error;
|
||||
}
|
||||
|
@ -757,7 +742,7 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
|
|||
&(mutex->owner->init_priority));
|
||||
}
|
||||
|
||||
/* wakeup suspended thread */
|
||||
/* wakeup suspended thread */
|
||||
if( !rt_list_isempty(&mutex->parent.suspend_thread) )
|
||||
{
|
||||
/* get thread entry */
|
||||
|
@ -946,7 +931,7 @@ rt_err_t rt_event_send(rt_event_t event, rt_uint32_t set)
|
|||
|
||||
/* set event */
|
||||
event->set |= set;
|
||||
|
||||
|
||||
if( !rt_list_isempty(&event->parent.suspend_thread) )
|
||||
{
|
||||
/* search thread list to resume thread */
|
||||
|
@ -1091,8 +1076,7 @@ rt_err_t rt_event_recv(rt_event_t event, rt_uint32_t set, rt_uint8_t option, rt_
|
|||
|
||||
if (thread->error != RT_EOK)
|
||||
{
|
||||
/* decrease suspended thread count */
|
||||
rt_ipc_object_decrease(&(event->parent));
|
||||
/* return error */
|
||||
return thread->error;
|
||||
}
|
||||
|
||||
|
@ -1293,7 +1277,7 @@ rt_err_t rt_mb_send (rt_mailbox_t mb, rt_uint32_t value)
|
|||
/* increase message entry */
|
||||
mb->entry ++;
|
||||
|
||||
/* resume suspended thread */
|
||||
/* resume suspended thread */
|
||||
if( !rt_list_isempty(&mb->parent.suspend_thread) )
|
||||
{
|
||||
rt_ipc_object_resume(&(mb->parent));
|
||||
|
@ -1383,8 +1367,7 @@ rt_err_t rt_mb_recv (rt_mailbox_t mb, rt_uint32_t* value, rt_int32_t timeout)
|
|||
/* resume from suspend state */
|
||||
if (thread->error != RT_EOK)
|
||||
{
|
||||
/* can't recv message, decrease suspended thread count */
|
||||
rt_ipc_object_decrease(&(mb->parent));
|
||||
/* return error */
|
||||
return thread->error;
|
||||
}
|
||||
|
||||
|
@ -1667,7 +1650,7 @@ rt_err_t rt_mq_send (rt_mq_t mq, void* buffer, rt_size_t size)
|
|||
/* increase message entry */
|
||||
mq->entry ++;
|
||||
|
||||
/* resume suspended thread */
|
||||
/* resume suspended thread */
|
||||
if( !rt_list_isempty(&mq->parent.suspend_thread) )
|
||||
{
|
||||
rt_ipc_object_resume(&(mq->parent));
|
||||
|
@ -1739,7 +1722,7 @@ rt_err_t rt_mq_urgent(rt_mq_t mq, void* buffer, rt_size_t size)
|
|||
/* increase message entry */
|
||||
mq->entry ++;
|
||||
|
||||
/* resume suspended thread */
|
||||
/* resume suspended thread */
|
||||
if( !rt_list_isempty(&mq->parent.suspend_thread) )
|
||||
{
|
||||
rt_ipc_object_resume(&(mq->parent));
|
||||
|
@ -1829,8 +1812,7 @@ rt_err_t rt_mq_recv (rt_mq_t mq, void* buffer, rt_size_t size, rt_int32_t timeou
|
|||
/* recv message */
|
||||
if (thread->error != RT_EOK)
|
||||
{
|
||||
/* decrease suspended thread count */
|
||||
rt_ipc_object_decrease(&(mq->parent));
|
||||
/* return error */
|
||||
return thread->error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue