X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FHeapStackCheck.cmm;h=ea2d64fa97beec374378c417d5e865ff66c98b21;hb=9e10d632f946bae5dd9a9ccd199c8345ca696d15;hp=363531055e93beb709201f590295dbe559d38f71;hpb=68f5bad2ae4d3342324d8a09102a9a4f9e49f896;p=ghc-hetmet.git diff --git a/ghc/rts/HeapStackCheck.cmm b/ghc/rts/HeapStackCheck.cmm index 3635310..ea2d64f 100644 --- a/ghc/rts/HeapStackCheck.cmm +++ b/ghc/rts/HeapStackCheck.cmm @@ -881,6 +881,26 @@ stg_block_putmvar BLOCK_BUT_FIRST(stg_block_putmvar_finally); } +// code fragment executed just before we return to the scheduler +stg_block_blackhole_finally +{ +#if defined(SMP) + // 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. + foreign "C" RELEASE_LOCK(sched_mutex "ptr"); +#endif + jump StgReturn; +} + +stg_block_blackhole +{ + Sp_adj(-2); + Sp(1) = R1; + Sp(0) = stg_enter_info; + BLOCK_BUT_FIRST(stg_block_blackhole_finally); +} + #ifdef mingw32_HOST_OS INFO_TABLE_RET( stg_block_async, 0/*framesize*/, 0/*bitmap*/, RET_SMALL ) {