kernel: mutex could only be released in thread context

Mutex has the idea of ownership, only the thread which owns the mutex
can release it. So rt_mutex_release could only be called in thread
context.  Add a debug guard to it.
This commit is contained in:
Grissiom 2013-10-14 09:50:18 +08:00
parent ca9b83c68f
commit b72001fcac

View File

@ -777,6 +777,9 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
need_schedule = RT_FALSE;
/* only thread could release mutex because we need test the ownership */
RT_DEBUG_IN_THREAD_CONTEXT;
/* get current thread */
thread = rt_thread_self();