1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1995-2005
5 * Data.Typeable support
7 * ---------------------------------------------------------------------------*/
9 #include "RtsTypeable.h"
14 static StgPtr typeableStore = 0;
16 Mutex typeableStoreLock;
25 initMutex(&typeableStoreLock);
33 closeMutex(&typeableStoreLock);
35 if(typeableStore!=0) {
36 freeStablePtr((StgStablePtr)typeableStore);
42 getOrSetTypeableStore(StgPtr ptr)
44 StgPtr ret = typeableStore;
47 ACQUIRE_LOCK(&typeableStoreLock);
51 typeableStore = ret = ptr;
54 RELEASE_LOCK(&typeableStoreLock);