projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Wrap gcc on Windows, to provide the -B flags
[ghc-hetmet.git]
/
rts
/
posix
/
FileLock.c
diff --git
a/rts/posix/FileLock.c
b/rts/posix/FileLock.c
index
e871be5
..
7023b9e
100644
(file)
--- a/
rts/posix/FileLock.c
+++ b/
rts/posix/FileLock.c
@@
-6,14
+6,16
@@
*
* ---------------------------------------------------------------------------*/
*
* ---------------------------------------------------------------------------*/
+#include "PosixSource.h"
#include "Rts.h"
#include "Rts.h"
-#include "Hash.h"
+
#include "FileLock.h"
#include "FileLock.h"
+#include "Hash.h"
#include "RtsUtils.h"
#include "RtsUtils.h"
-#include "OSThreads.h"
-#include <unistd.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <sys/stat.h>
+#include <unistd.h>
#include <errno.h>
typedef struct {
#include <errno.h>
typedef struct {
@@
-52,6
+54,9
@@
initFileLocking(void)
{
obj_hash = allocHashTable_(hashLock, cmpLocks);
fd_hash = allocHashTable(); /* ordinary word-based table */
{
obj_hash = allocHashTable_(hashLock, cmpLocks);
fd_hash = allocHashTable(); /* ordinary word-based table */
+#ifdef THREADED_RTS
+ initMutex(&file_lock_mutex);
+#endif
}
static void
}
static void
@@
-65,6
+70,9
@@
freeFileLocking(void)
{
freeHashTable(obj_hash, freeLock);
freeHashTable(fd_hash, NULL);
{
freeHashTable(obj_hash, freeLock);
freeHashTable(fd_hash, NULL);
+#ifdef THREADED_RTS
+ closeMutex(&file_lock_mutex);
+#endif
}
int
}
int