X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FStable.c;h=97796b89a79b843fb59d69d8e51de2d1a58256cd;hb=2da37f4f15790377900fa6c38ff8fdcd394dfaa2;hp=a2c47d785c64cd1d48c055a2e86d3af2e728edb4;hpb=4d15b247104d9cfe36a4e29f7df00e582e7ec9f0;p=ghc-hetmet.git diff --git a/rts/Stable.c b/rts/Stable.c index a2c47d7..97796b8 100644 --- a/rts/Stable.c +++ b/rts/Stable.c @@ -6,9 +6,6 @@ * * ---------------------------------------------------------------------------*/ -// Make static versions of inline functions in Stable.h: -#define RTS_STABLE_C - #include "PosixSource.h" #include "Rts.h" #include "Hash.h" @@ -319,6 +316,23 @@ enlargeStablePtrTable(void) } /* ----------------------------------------------------------------------------- + * We must lock the StablePtr table during GC, to prevent simultaneous + * calls to freeStablePtr(). + * -------------------------------------------------------------------------- */ + +void +stablePtrPreGC(void) +{ + ACQUIRE_LOCK(&stable_mutex); +} + +void +stablePtrPostGC(void) +{ + RELEASE_LOCK(&stable_mutex); +} + +/* ----------------------------------------------------------------------------- * Treat stable pointers as roots for the garbage collector. * * A stable pointer is any stable name entry with a ref > 0. We'll