+/*
+ * Function: passCapability(Mutex*, Capability*, Condition*)
+ *
+ * Purpose: Let go of the capability and make sure the thread associated
+ * with the Condition pTargetThreadCond gets it next.
+ *
+ * Pre-condition: pMutex is held and cap is held by the current thread
+ * Post-condition: pMutex is held; cap will be grabbed by the "target"
+ * thread when pMutex is released.
+ */
+
+void
+passCapability(Mutex* pMutex, Capability* cap, Condition *pTargetThreadCond)
+{
+#ifdef SMP
+ #error SMP version not implemented
+#endif
+ ASSERT(rts_n_free_capabilities == 0);
+ rts_n_free_capabilities = 1;
+ signalCondition(pTargetThreadCond);
+ passTarget = pTargetThreadCond;
+ passingCapability = rtsTrue;
+ IF_DEBUG(scheduler, sched_belch("worker: passCapability"));
+}
+
+/*
+ * Function: passCapabilityToWorker(Mutex*, Capability*)
+ *
+ * Purpose: Let go of the capability and make sure that a
+ * "plain" worker thread (not a bound thread) gets it next.
+ *
+ * Pre-condition: pMutex is held and cap is held by the current thread
+ * Post-condition: pMutex is held; cap will be grabbed by the "target"
+ * thread when pMutex is released.
+ */
+
+void
+passCapabilityToWorker(Mutex* pMutex, Capability* cap)
+{
+#ifdef SMP
+ #error SMP version not implemented
+#endif
+ rts_n_free_capabilities = 1;
+ signalCondition(&thread_ready_cond);
+ startSchedulerTaskIfNecessary();
+ passTarget = NULL;
+ passingCapability = rtsTrue;
+ IF_DEBUG(scheduler, sched_belch("worker: passCapabilityToWorker"));
+}
+
+
+