X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FStable.c;h=09efb6accc6cc3417312050f615fcd7e9d08198c;hb=12694df2b002fe264d1e9e8209e0fbb6914ffe50;hp=818f0f09b5a22e64429bf7245e4cb4e7455c1bf0;hpb=a141bd3ba4a1adbace30ac6c625ff9defca62b07;p=ghc-hetmet.git diff --git a/ghc/rts/Stable.c b/ghc/rts/Stable.c index 818f0f0..09efb6a 100644 --- a/ghc/rts/Stable.c +++ b/ghc/rts/Stable.c @@ -80,7 +80,9 @@ static snEntry *stable_ptr_free = NULL; static unsigned int SPT_size = 0; +#ifdef THREADED_RTS static Mutex stable_mutex; +#endif /* This hash table maps Haskell objects to stable names, so that every * call to lookupStableName on a given object will return the same @@ -143,7 +145,9 @@ initStablePtrTable(void) // // Also, getStablePtr is now called from __attribute__((constructor)) // functions, so initialising things here wouldn't work anyway. +#ifdef THREADED_RTS initMutex(&stable_mutex); +#endif } /* @@ -188,7 +192,6 @@ lookupStableName_(StgPtr p) if (sn != 0) { ASSERT(stable_ptr_table[sn].addr == p); IF_DEBUG(stable,debugBelch("cached stable name %ld at %p\n",sn,p)); - RELEASE_LOCK(&stable_mutex); return sn; } else { sn = stable_ptr_free - stable_ptr_table;