X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fposix%2FFileLock.c;h=7023b9ef67465bd16e43dca2a71c03a05381ef2f;hb=d108044bef62f6a0d579c92ced5e8188f72edc2d;hp=e871be5ee0e627b6666e527414acb562c73ab190;hpb=e345a13029b7654730a4d8f6be730e8b96812a27;p=ghc-hetmet.git diff --git a/rts/posix/FileLock.c b/rts/posix/FileLock.c index e871be5..7023b9e 100644 --- a/rts/posix/FileLock.c +++ b/rts/posix/FileLock.c @@ -6,14 +6,16 @@ * * ---------------------------------------------------------------------------*/ +#include "PosixSource.h" #include "Rts.h" -#include "Hash.h" + #include "FileLock.h" +#include "Hash.h" #include "RtsUtils.h" -#include "OSThreads.h" -#include +#include #include +#include #include typedef struct { @@ -52,6 +54,9 @@ initFileLocking(void) { obj_hash = allocHashTable_(hashLock, cmpLocks); fd_hash = allocHashTable(); /* ordinary word-based table */ +#ifdef THREADED_RTS + initMutex(&file_lock_mutex); +#endif } static void @@ -65,6 +70,9 @@ freeFileLocking(void) { freeHashTable(obj_hash, freeLock); freeHashTable(fd_hash, NULL); +#ifdef THREADED_RTS + closeMutex(&file_lock_mutex); +#endif } int