Changeset 274
- Timestamp:
- Mar 9, 2011, 9:38:55 PM (14 years ago)
- Location:
- trunk/openjdk/jdk
- Files:
-
- 1 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk/jdk/make/common/Library.gmk
r245 r274 340 340 OTHER_INCLUDES += -I$(PLATFORM_SRC_OS2)/native/common 341 341 OTHER_INCLUDES += -I$(PLATFORM_SRC_OS2)/native/$(PKGDIR) 342 # path to common code used by many DLLs 343 vpath %.cpp $(PLATFORM_SRC_OS2)/native/common 342 344 endif 343 345 -
trunk/openjdk/jdk/make/javax/sound/FILES_c.gmk
r255 r274 33 33 PLATFORM_API_SolarisOS_PCM.c 34 34 35 FILES_linux = 35 FILES_linux = 36 36 37 37 FILES_windows = \ … … 46 46 PLATFORM_API_WinOS_Util.c \ 47 47 PLATFORM_API_WinOS_Ports.c 48 48 49 ifeq ($(PLATFORM), os2) 50 FILES_cpp += \ 51 jdk_DllMain.cpp 52 endif 53 49 54 FILES_export = \ 50 55 com/sun/media/sound/Platform.java -
trunk/openjdk/jdk/make/javax/sound/jsoundds/Makefile
r255 r274 47 47 PLATFORM_API_WinOS_DirectSound.cpp 48 48 49 ifeq ($(PLATFORM), os2) 50 FILES_cpp += \ 51 jdk_DllMain.cpp 52 endif 53 49 54 FILES_export = \ 50 55 $(DAUDIOFILES_export) -
trunk/openjdk/jdk/make/sun/awt/Makefile
r263 r274 94 94 include FILES_export_windows.gmk 95 95 96 FILES_c += awt_init.c96 FILES_cpp += jdk_DllMain.cpp 97 97 98 98 # -
trunk/openjdk/jdk/src/os2/native/common/jdk_DllMain.cpp
r272 r274 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * 5 * Copyright 2010 netlabs.org. OS/2 Parts.5 * Copyright 2010-2011 netlabs.org. OS/2 Parts. 6 6 * 7 7 * This code is free software; you can redistribute it and/or modify it … … 26 26 */ 27 27 28 // This code performs C++ runtime initialization and registers the DLL 29 // with Odin 28 // This code performs C++ runtime termination to make sure that the 29 // destructors of static objects are destroyed before Odin unloads itself 30 // at program termination. This is achieved by registering the DLL with Odin 31 // which makes sure it calls the supplied DllMain() routine at the right 32 // time. Note that using DosExitList() for this purpose is not a good idea 33 // because some Odin services still needed by the destructor code of some JDK 34 // classes may already be down when exit list routines are run. 30 35 31 36 #define INCL_DOSPROCESS … … 33 38 #include <odinlx.h> 34 39 #include <misc.h> 35 #include <exitlist.h>36 37 //#include <types.h>38 //#include <stdio.h>39 40 40 41 #include <emx/startup.h> 41 42 42 static void APIENTRY cleanup(ULONG reason);43 static HMODULE dllHandle = 0; 43 44 44 static HMODULE dllHandle = 0; 45 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) 46 { 47 // call destructors when detaching the DLL from the process 48 if (reason == 0) 49 __ctordtorTerm(); 50 51 return TRUE; 52 } 45 53 46 54 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long ulFlag) 47 55 { 48 APIRET rc;49 50 56 // If ulFlag is zero then the DLL is being loaded so initialization should 51 57 // be performed. If ulFlag is 1 then the DLL is being freed so termination … … 53 59 54 60 // Note that we don't perform CRT initialization and things because this 55 // is done in os_os2_init.cpp of JVM.DLL that is al ready loaded61 // is done in os_os2_init.cpp of JVM.DLL that is always loaded first 56 62 57 63 switch (ulFlag) { 58 64 case 0 : 59 dllHandle = RegisterLxDll(hModule, NULL, NULL,65 dllHandle = RegisterLxDll(hModule, DllMain, NULL, 60 66 ODINNT_MAJOR_VERSION, 61 67 ODINNT_MINOR_VERSION, … … 66 72 __ctordtorInit(); 67 73 68 rc = DosExitList(EXITLIST_APPDLL|EXLST_ADD, cleanup);69 if (rc)70 break;71 72 74 return 1; 73 75 74 76 case 1 : 75 if (dllHandle) {77 if (dllHandle) 76 78 UnregisterLxDll(dllHandle); 77 }78 79 return 1; 79 80 … … 85 86 return 0; 86 87 } 87 88 static void APIENTRY cleanup(ULONG /*ulReason*/)89 {90 __ctordtorTerm();91 DosExitList(EXLST_EXIT, cleanup);92 return ;93 }94
Note:
See TracChangeset
for help on using the changeset viewer.