+#if defined(RTS_SUPPORTS_THREADS)
+/* ToDo: carefully document the invariants that go together
+ * with these synchronisation objects.
+ */
+Mutex sched_mutex = INIT_MUTEX_VAR;
+Mutex term_mutex = INIT_MUTEX_VAR;
+#if defined(THREADED_RTS)
+/*
+ * The rts_mutex is the 'big lock' that the active native
+ * thread within the RTS holds while executing code.
+ * It is given up when the thread makes a transition out of
+ * the RTS (e.g., to perform an external C call), hopefully
+ * for another thread to take over its chores and enter
+ * the RTS.
+ *
+ */
+Mutex rts_mutex = INIT_MUTEX_VAR;
+/*
+ * When a native thread has completed executing an external
+ * call, it needs to communicate the result back to the
+ * (Haskell) thread that made the call. Do this as follows:
+ *
+ * - in resumeThread(), the thread increments the counter
+ * threads_waiting, and then blocks on the 'big' RTS lock.
+ * - upon entry to the scheduler, the thread that's currently
+ * holding the RTS lock checks threads_waiting. If there
+ * are native threads waiting, it gives up its RTS lock
+ * and tries to re-grab the RTS lock [perhaps after having
+ * waited for a bit..?]
+ * - care must be taken to deal with the case where more than
+ * one external thread are waiting on the lock. [ToDo: more]
+ *
+ */
+
+static nat threads_waiting = 0;
+/*
+ * thread_ready_aux_mutex is used to handle the scenario where the
+ * the RTS executing thread runs out of work, but there are
+ * active external threads. The RTS executing thread gives up
+ * its RTS mutex, and blocks waiting for the thread_ready_cond.
+ * Unfortunately, a condition variable needs to be associated
+ * with a mutex in pthreads, so rts_thread_waiting_mutex is
+ * used for just this purpose.
+ *
+ */
+Mutex thread_ready_aux_mutex = INIT_MUTEX_VAR;
+#endif
+
+
+/* thread_ready_cond: when signalled, a thread has
+ * become runnable. When used?
+ */
+Condition thread_ready_cond = INIT_COND_VAR;
+Condition gc_pending_cond = INIT_COND_VAR;