X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fposix%2FOSThreads.c;h=510a51d4451bed7afadb2d793300d75fd342d4e0;hb=150cc9e2e4657cc58bd7ec4c15e5cb72f2e1c0f6;hp=cff37824cbc40cf1485d87c29295684be8ff0ab7;hpb=a91cc8496bf4ea7fe1e3ad9d97836152f3939ffa;p=ghc-hetmet.git diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c index cff3782..510a51d 100644 --- a/rts/posix/OSThreads.c +++ b/rts/posix/OSThreads.c @@ -93,6 +93,14 @@ osThreadId() return pthread_self(); } +rtsBool +osThreadIsAlive(OSThreadId id STG_UNUSED) +{ + // no good way to implement this on POSIX, AFAICT. Returning true + // is safe. + return rtsTrue; +} + void initMutex(Mutex* pMut) { @@ -106,6 +114,11 @@ initMutex(Mutex* pMut) #endif return; } +void +closeMutex(Mutex* pMut) +{ + pthread_mutex_destroy(pMut); +} void newThreadLocalKey (ThreadLocalKey *key) @@ -135,6 +148,15 @@ setThreadLocalVar (ThreadLocalKey *key, void *value) } } +void +freeThreadLocalKey (ThreadLocalKey *key) +{ + int r; + if ((r = pthread_key_delete(*key)) != 0) { + barf("freeThreadLocalKey: %s", strerror(r)); + } +} + static void * forkOS_createThreadWrapper ( void * entry ) {