提交 3bfe93e3 编写于 作者: B bernard.xiong

fix mutex release bug

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@45 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 91ed3ab1
......@@ -764,6 +764,9 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
&(mutex->owner->init_priority));
}
/* increase value */
mutex->value ++;
/* wakeup suspended thread */
if (mutex->value <= 0 && mutex->parent.suspend_thread_count > 0)
{
......@@ -783,8 +786,9 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
}
else
{
/* increase value */
mutex->value ++;
/* clear owner */
mutex->owner = RT_NULL;
mutex->original_priority = 0;
}
/* enable interrupt */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册