Commit 53c390a4 authored by Simon Marlow's avatar Simon Marlow
Browse files

remove ^Ms

parent 59c03ecb
#include "RtsTypeable.h"
#include "Rts.h"
static StgPtr typeableStore = 0;
#ifdef THREADED_RTS
Mutex typeableStoreLock;
#endif
void
initTypeableStore()
{
typeableStore=0;
#ifdef THREADED_RTS
initMutex(&typeableStoreLock);
#endif
}
void
exitTypeableStore()
{
#ifdef THREADED_RTS
closeMutex(&typeableStoreLock);
#endif
if(typeableStore!=0) {
freeStablePtr((StgStablePtr)typeableStore);
typeableStore=0;
}
}
StgPtr
getOrSetTypeableStore(StgPtr ptr)
{
StgPtr ret = typeableStore;
if(ret==0) {
#ifdef THREADED_RTS
ACQUIRE_LOCK(&typeableStoreLock);
ret=typeableStore;
if(ret==0) {
#endif
typeableStore = ret = ptr;
#ifdef THREADED_RTS
}
RELEASE_LOCK(&typeableStoreLock);
#endif
}
return ret;
}
static StgPtr typeableStore = 0;
#ifdef THREADED_RTS
Mutex typeableStoreLock;
#endif
void
initTypeableStore()
{
typeableStore=0;
#ifdef THREADED_RTS
initMutex(&typeableStoreLock);
#endif
}
void
exitTypeableStore()
{
#ifdef THREADED_RTS
closeMutex(&typeableStoreLock);
#endif
if(typeableStore!=0) {
freeStablePtr((StgStablePtr)typeableStore);
typeableStore=0;
}
}
StgPtr
getOrSetTypeableStore(StgPtr ptr)
{
StgPtr ret = typeableStore;
if(ret==0) {
#ifdef THREADED_RTS
ACQUIRE_LOCK(&typeableStoreLock);
ret=typeableStore;
if(ret==0) {
#endif
typeableStore = ret = ptr;
#ifdef THREADED_RTS
}
RELEASE_LOCK(&typeableStoreLock);
#endif
}
return ret;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment