+ /* set up my own style of waitqueue */
+ waiter.task = tsk;
+
+
+/*
+ * release a single token back to a mutex
+ * - entered with lock held and interrupts disabled
+ * - the queue will not be empty
+ */
+void __up(struct mutex *mutex)
+{
+ struct mutex_waiter *waiter;
+ struct task_struct *tsk;
+
+ /* grant the token to the process at the front of the queue */
+ waiter = list_entry(mutex->wait_list.next, struct mutex_waiter, list);
+
+ /* we must be careful not to touch 'waiter' after we set ->task = NULL.
+ * - it is an allocated on the waiter's stack and may become invalid at
+ * any time after that point (due to a wakeup from another source).
+ */
+ list_del_init(&waiter->list);
+ tsk = waiter->task;
+#ifdef CONFIG_DEBUG_MUTEX_OWNER
+ mutex->__owner = tsk;
+#endif
+ mb();
+ waiter->task = NULL;
+ wake_up_process(tsk);
+ put_task_struct(tsk);
+}