X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FStgMiscClosures.cmm;h=7f7cf78f7b95cfbe350fc112323a4749b5d7a004;hb=5892af0e08fdb890b5a0b9a64346d9f7773a6ed8;hp=205d7ac09ffb8b73e1c9f68d6a661fb146c1923d;hpb=897301c7e96976aae30ed6ad23b0b682151cd734;p=ghc-hetmet.git diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index 205d7ac..7f7cf78 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -14,7 +14,7 @@ import pthread_mutex_lock; import ghczmprim_GHCziTypes_Czh_static_info; -import base_GHCziBase_Izh_static_info; +import ghczmprim_GHCziTypes_Izh_static_info; import EnterCriticalSection; import LeaveCriticalSection; @@ -384,14 +384,33 @@ INFO_TABLE(stg_CAF_BLACKHOLE,0,1,CAF_BLACKHOLE,"CAF_BLACKHOLE","CAF_BLACKHOLE") jump stg_block_blackhole; } -#ifdef EAGER_BLACKHOLING -INFO_TABLE(stg_SE_BLACKHOLE,0,1,SE_BLACKHOLE,"SE_BLACKHOLE","SE_BLACKHOLE") -{ foreign "C" barf("SE_BLACKHOLE object entered!") never returns; } +INFO_TABLE(__stg_EAGER_BLACKHOLE,0,1,BLACKHOLE,"EAGER_BLACKHOLE","EAGER_BLACKHOLE") +{ + TICK_ENT_BH(); + +#ifdef THREADED_RTS + // foreign "C" debugBelch("BLACKHOLE entry\n"); +#endif -INFO_TABLE(stg_SE_CAF_BLACKHOLE,0,1,SE_CAF_BLACKHOLE,"SE_CAF_BLACKHOLE","SE_CAF_BLACKHOLE") -{ foreign "C" barf("SE_CAF_BLACKHOLE object entered!") never returns; } + /* Actually this is not necessary because R1 is about to be destroyed. */ + LDV_ENTER(R1); + +#if defined(THREADED_RTS) + ACQUIRE_LOCK(sched_mutex "ptr"); + // released in stg_block_blackhole_finally #endif + /* Put ourselves on the blackhole queue */ + StgTSO__link(CurrentTSO) = W_[blackhole_queue]; + W_[blackhole_queue] = CurrentTSO; + + /* jot down why and on what closure we are blocked */ + StgTSO_why_blocked(CurrentTSO) = BlockedOnBlackHole::I16; + StgTSO_block_info(CurrentTSO) = R1; + + jump stg_block_blackhole; +} + /* ---------------------------------------------------------------------------- Whiteholes are used for the "locked" state of a closure (see lockClosure()) ------------------------------------------------------------------------- */ @@ -596,10 +615,10 @@ CLOSURE(stg_dummy_ret_closure,stg_dummy_ret); */ #warning Is this correct? _imp is a pointer! #define Char_hash_static_info _imp__ghczmprim_GHCziTypes_Czh_static_info -#define Int_hash_static_info _imp__base_GHCziBase_Izh_static_info +#define Int_hash_static_info _imp__ghczmprim_GHCziTypes_Izh_static_info #else #define Char_hash_static_info ghczmprim_GHCziTypes_Czh_static_info -#define Int_hash_static_info base_GHCziBase_Izh_static_info +#define Int_hash_static_info ghczmprim_GHCziTypes_Izh_static_info #endif