projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix passing double quotes to GHC on Windows
[ghc-hetmet.git]
/
rts
/
win32
/
OSThreads.c
diff --git
a/rts/win32/OSThreads.c
b/rts/win32/OSThreads.c
index
6f3629b
..
13a3666
100644
(file)
--- a/
rts/win32/OSThreads.c
+++ b/
rts/win32/OSThreads.c
@@
-13,6
+13,7
@@
#if defined(THREADED_RTS)
#include "OSThreads.h"
#include "RtsUtils.h"
#if defined(THREADED_RTS)
#include "OSThreads.h"
#include "RtsUtils.h"
+#include <windows.h>
/* For reasons not yet clear, the entire contents of process.h is protected
* by __STRICT_ANSI__ not being defined.
/* For reasons not yet clear, the entire contents of process.h is protected
* by __STRICT_ANSI__ not being defined.
@@
-197,6
+198,17
@@
setThreadLocalVar (ThreadLocalKey *key, void *value)
}
}
}
}
+void
+freeThreadLocalKey (ThreadLocalKey *key)
+{
+ BOOL r;
+ r = TlsFree(*key);
+ if (r == 0) {
+ DWORD dw = GetLastError();
+ barf("freeThreadLocalKey failed: %lu", dw);
+ }
+}
+
static unsigned __stdcall
forkOS_createThreadWrapper ( void * entry )
static unsigned __stdcall
forkOS_createThreadWrapper ( void * entry )
@@
-220,6
+232,14
@@
forkOS_createThread ( HsStablePtr entry )
(unsigned*)&pId) == 0);
}
(unsigned*)&pId) == 0);
}
+void CCallEnterCriticalSection(LPCRITICAL_SECTION s) {
+ EnterCriticalSection(s);
+}
+
+void CCallLeaveCriticalSection(LPCRITICAL_SECTION s) {
+ LeaveCriticalSection(s);
+}
+
#else /* !defined(THREADED_RTS) */
int
#else /* !defined(THREADED_RTS) */
int