X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FHeapStackCheck.cmm;h=3980ca2dd10a5d476f51f867f4a17cc809ef5bce;hb=66579ff945831c5fc9a17c58c722ff01f2268d76;hp=a4fb5c0a16729402bb9c36d20280426360091c12;hpb=4d93c987a690eda8fbd9d2e4c7b103005dd8836a;p=ghc-hetmet.git diff --git a/rts/HeapStackCheck.cmm b/rts/HeapStackCheck.cmm index a4fb5c0..3980ca2 100644 --- a/rts/HeapStackCheck.cmm +++ b/rts/HeapStackCheck.cmm @@ -15,6 +15,8 @@ #ifdef __PIC__ import pthread_mutex_unlock; #endif +import EnterCriticalSection; +import LeaveCriticalSection; /* Stack/Heap Check Failure * ------------------------ @@ -64,7 +66,7 @@ import pthread_mutex_unlock; CLOSE_NURSERY(); \ CurrentNursery = bdescr_link(CurrentNursery); \ OPEN_NURSERY(); \ - if (CInt[context_switch] != 0 :: CInt) { \ + if (Capability_context_switch(MyCapability()) != 0 :: CInt) { \ R1 = ThreadYielding; \ goto sched; \ } else { \ @@ -825,7 +827,9 @@ INFO_TABLE_RET( stg_block_takemvar, RET_SMALL, "ptr" W_ unused ) stg_block_takemvar_finally { #ifdef THREADED_RTS - unlockClosure(R3, stg_EMPTY_MVAR_info); + unlockClosure(R3, stg_MVAR_DIRTY_info); +#else + SET_INFO(R3, stg_MVAR_DIRTY_info); #endif jump StgReturn; } @@ -851,7 +855,9 @@ INFO_TABLE_RET( stg_block_putmvar, RET_SMALL, "ptr" W_ unused1, "ptr" W_ unused2 stg_block_putmvar_finally { #ifdef THREADED_RTS - unlockClosure(R3, stg_FULL_MVAR_info); + unlockClosure(R3, stg_MVAR_DIRTY_info); +#else + SET_INFO(R3, stg_MVAR_DIRTY_info); #endif jump StgReturn; } @@ -873,7 +879,7 @@ stg_block_blackhole_finally // 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"); + RELEASE_LOCK(sched_mutex "ptr"); #endif jump StgReturn; }