+stg_returnToSched
+{
+ SAVE_THREAD_STATE();
+ foreign "C" threadPaused(CurrentTSO);
+ jump StgReturn;
+}
+
+// A variant of stg_returnToSched, but instead of returning directly to the
+// scheduler, we jump to the code fragment pointed to by R2. This lets us
+// perform some final actions after making the thread safe, such as unlocking
+// the MVar on which we are about to block in SMP mode.
+stg_returnToSchedButFirst
+{
+ SAVE_THREAD_STATE();
+ foreign "C" threadPaused(CurrentTSO);
+ jump R2;
+}
+