Commit 5ff765fb authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/mutex: export flushing routine


Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent ac2a1ba8
......@@ -48,7 +48,7 @@ void evl_init_mutex_pp(struct evl_mutex *mutex,
atomic_t *fastlock,
u32 *ceiling_ref);
bool evl_destroy_mutex(struct evl_mutex *mutex);
void evl_destroy_mutex(struct evl_mutex *mutex);
int evl_trylock_mutex(struct evl_mutex *mutex);
......@@ -64,6 +64,9 @@ void __evl_unlock_mutex(struct evl_mutex *mutex);
void evl_unlock_mutex(struct evl_mutex *mutex);
void evl_flush_mutex(struct evl_mutex *mutex,
int reason);
void evl_commit_mutex_ceiling(struct evl_mutex *mutex);
#ifdef CONFIG_EVENLESS_DEBUG_MUTEX_INBAND
......
......@@ -334,31 +334,32 @@ void evl_init_mutex_pp(struct evl_mutex *mutex,
}
EXPORT_SYMBOL_GPL(evl_init_mutex_pp);
bool evl_destroy_mutex(struct evl_mutex *mutex)
void evl_flush_mutex(struct evl_mutex *mutex, int reason)
{
struct evl_thread *waiter, *tmp;
unsigned long flags;
bool ret;
xnlock_get_irqsave(&nklock, flags);
trace_evl_mutex_flush(mutex);
trace_evl_mutex_destroy(mutex);
xnlock_get_irqsave(&nklock, flags);
if (list_empty(&mutex->wait_list)) {
if (list_empty(&mutex->wait_list))
EVL_WARN_ON(CORE, mutex->flags & EVL_MUTEX_CLAIMED);
ret = false;
} else {
ret = true;
else {
list_for_each_entry_safe(waiter, tmp, &mutex->wait_list, wait_next)
evl_wakeup_thread(waiter, T_PEND, T_RMID);
evl_wakeup_thread(waiter, T_PEND, reason);
if (mutex->flags & EVL_MUTEX_CLAIMED)
clear_pi_boost(mutex, mutex->owner);
}
xnlock_put_irqrestore(&nklock, flags);
}
return ret;
void evl_destroy_mutex(struct evl_mutex *mutex)
{
trace_evl_mutex_destroy(mutex);
evl_flush_mutex(mutex, T_RMID);
}
EXPORT_SYMBOL_GPL(evl_destroy_mutex);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment