// code fragment executed just before we return to the scheduler
stg_block_takemvar_finally
{
-#ifdef SMP
+#ifdef THREADED_RTS
foreign "C" unlockClosure(R3 "ptr", stg_EMPTY_MVAR_info);
#endif
jump StgReturn;
// code fragment executed just before we return to the scheduler
stg_block_putmvar_finally
{
-#ifdef SMP
+#ifdef THREADED_RTS
foreign "C" unlockClosure(R3 "ptr", stg_FULL_MVAR_info);
#endif
jump StgReturn;
// code fragment executed just before we return to the scheduler
stg_block_blackhole_finally
{
-#if defined(SMP)
+#if defined(THREADED_RTS)
// The last thing we do is release sched_lock, which is
// preventing other threads from accessing blackhole_queue and
// picking up this thread before we are finished with it.
}
#endif
+
+/* -----------------------------------------------------------------------------
+ STM-specific waiting
+ -------------------------------------------------------------------------- */
+
+stg_block_stmwait_finally
+{
+ foreign "C" stmWaitUnlock(MyCapability() "ptr", R3 "ptr");
+ jump StgReturn;
+}
+
+stg_block_stmwait
+{
+ BLOCK_BUT_FIRST(stg_block_stmwait_finally);
+}