FIX #2164: check for ThreadRelocated in isAlive()
[ghc.git] / rts / RtsDllMain.c
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team 1999-2000
4 *
5 * Entry point for RTS-in-a-DLL
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #include "PosixSource.h"
10 #include "Rts.h"
11 #include "RtsAPI.h"
12
13 #ifdef HAVE_WINDOWS_H
14 #include <windows.h>
15 #endif
16
17 /* I'd be mildly surprised if this wasn't defined, but still. */
18 #if defined(__PIC__) && defined(mingw32_TARGET_OS)
19 BOOL
20 WINAPI
21 DllMain ( HINSTANCE hInstance
22 , DWORD reason
23 , LPVOID reserved
24 )
25 {
26 /*
27 * Note: the DllMain() doesn't call startupHaskell() for you,
28 * that is the task of users of the RTS. The reason is
29 * that *you* want to be able to control the arguments
30 * you pass to the RTS.
31 */
32 switch (reason) {
33 case DLL_PROCESS_DETACH: shutdownHaskell();
34 }
35 return TRUE;
36 }
37
38 #endif /* defined(__PIC__) && defined(mingw32_TARGET_OS) */