X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FStable.c;h=97796b89a79b843fb59d69d8e51de2d1a58256cd;hb=d874b8c93b737bf26c949ef7bf19fc43e335bd1f;hp=94a756a380e99de025f360dce2c889a038f9da51;hpb=99df892cc9620fcc92747b79bba75dad8a1d295c;p=ghc-hetmet.git diff --git a/rts/Stable.c b/rts/Stable.c index 94a756a..97796b8 100644 --- a/rts/Stable.c +++ b/rts/Stable.c @@ -316,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