harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r523227 - in /harmony/enhanced/classlib/trunk: depends/build/ make/ modules/archive/src/main/native/zip/shared/ modules/awt/src/main/native/win32wrapper/windows/ modules/luni/src/main/native/launcher/shared/ modules/luni/src/main/native/lau...
Date Wed, 28 Mar 2007 08:22:35 GMT
Author: hindessm
Date: Wed Mar 28 01:22:33 2007
New Revision: 523227

URL: http://svn.apache.org/viewvc?view=rev&rev=523227
Log:
Changes for "[#HARMONY-3090] Create a new table based API for thread
library functions".  Currently as an option, -Dhy.no.thr=true, (default
false) until all VMs are ready.  Note that hy.no.thr=true implies
hy.no.sig=true because I was too lazy to port the unnecessary sig code.

Modified:
    harmony/enhanced/classlib/trunk/depends/build/defines.mak
    harmony/enhanced/classlib/trunk/depends/build/defines.mk
    harmony/enhanced/classlib/trunk/make/properties.xml
    harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/win32wrapper/windows/makefile
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/unix/makefile
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javae
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javaw
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/winmain.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c
    harmony/enhanced/classlib/trunk/modules/portlib/build.xml
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hytlshelpers.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysignal.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hysignal.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/makefile

Modified: harmony/enhanced/classlib/trunk/depends/build/defines.mak
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/depends/build/defines.mak?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/depends/build/defines.mak (original)
+++ harmony/enhanced/classlib/trunk/depends/build/defines.mak Wed Mar 28 01:22:33 2007
@@ -58,7 +58,13 @@
 HYCFLAGS = $(HYRELEASECFLAGS) $(HYCOMMONCFLAGS)
 !ENDIF
   
-MDLLIBFILES = $(LIBPATH)hythr.lib $(LIBPATH)hycommon.lib
+MDLLIBFILES = $(LIBPATH)hycommon.lib
+  
+!IF "$(HY_NO_THR)" == "false"
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hythr.lib
+!ELSE
+HYCFLAGS = $(HYCFLAGS) -DHY_NO_THR
+!ENDIF
   
 !IF "$(HY_NO_SIG)" == "false"
 MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hysig.lib

Modified: harmony/enhanced/classlib/trunk/depends/build/defines.mk
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/depends/build/defines.mk?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/depends/build/defines.mk (original)
+++ harmony/enhanced/classlib/trunk/depends/build/defines.mk Wed Mar 28 01:22:33 2007
@@ -66,7 +66,13 @@
 OPT += $(HYDEBUGCFLAGS)
 endif
 
-MDLLIBFILES = $(DLLPATH)libhythr.so $(LIBPATH)libhycommon.a
+MDLLIBFILES = $(LIBPATH)libhycommon.a
+
+ifeq ($(HY_NO_THR),false)
+MDLLIBFILES += $(DLLPATH)libhythr.so
+else
+DEFINES += -DHY_NO_THR
+endif
 
 ifeq ($(HY_NO_SIG),false)
 MDLLIBFILES += $(DLLPATH)libhysig.so

Modified: harmony/enhanced/classlib/trunk/make/properties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/properties.xml?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/make/properties.xml (original)
+++ harmony/enhanced/classlib/trunk/make/properties.xml Wed Mar 28 01:22:33 2007
@@ -225,7 +225,14 @@
               value="exclude.${hy.platform}.${hy.test.vm.name}.interm" />
 
     <!-- flags -->
-    <property name="hy.no.sig" value="false" />
+    <property name="hy.no.thr" value="false" />
+    <condition property="hy.skip.thr" value="true">
+        <not>
+            <equals arg1="${hy.no.thr}" arg2="false" />
+        </not>
+    </condition>
+
+    <property name="hy.no.sig" value="${hy.no.thr}" />
     <condition property="hy.skip.sig" value="true">
         <not>
             <equals arg1="${hy.no.sig}" arg2="false" />
@@ -397,6 +404,7 @@
                 <env key="HY_OS" value="${hy.os}" />
                 <env key="HY_PLATFORM" value="${hy.platform}" />
                 <env key="HY_NO_SIG" value="${hy.no.sig}" />
+                <env key="HY_NO_THR" value="${hy.no.thr}" />
                 <arg line="${make.arg}" />
                 <arg line="@{target}" />
             </exec>

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c (original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c Wed
Mar 28 01:22:33 2007
@@ -1115,7 +1115,9 @@
 zip_closeZipFile (HyPortLibrary * portLib, struct HyZipFile * zipFile)
 {
   PORT_ACCESS_FROM_PORT (portLib);
-
+#if defined(HY_NO_THR)
+  THREAD_ACCESS_FROM_PORT(portLib);
+#endif /* HY_NO_THR */
   IDATA fd;
 
   ENTER ();
@@ -1325,6 +1327,9 @@
                      HyZipEntry * zipEntry, IDATA * nextEntryPointer)
 {
   PORT_ACCESS_FROM_PORT (portLib);
+#if defined(HY_NO_THR)
+  THREAD_ACCESS_FROM_PORT(portLib);
+#endif /* HY_NO_THR */
   IDATA result;
   BOOLEAN retryAllowed = TRUE;
   IDATA pointer;
@@ -1447,6 +1452,9 @@
                  BOOLEAN findDirectory)
 {
   PORT_ACCESS_FROM_PORT (portLib);
+#if defined(HY_NO_THR)
+  THREAD_ACCESS_FROM_PORT(portLib);
+#endif /* HY_NO_THR */
   IDATA result, position;
   BOOLEAN retryAllowed = TRUE;
   I_64 seekResult;
@@ -1584,6 +1592,9 @@
                      HyZipEntry * entry, U_8 * buffer, U_32 bufferSize)
 {
   PORT_ACCESS_FROM_PORT (portLib);
+#if defined(HY_NO_THR)
+  THREAD_ACCESS_FROM_PORT(portLib);
+#endif /* HY_NO_THR */
 
   I_32 result;
   U_8 *dataBuffer;
@@ -1754,6 +1765,9 @@
                            HyZipEntry * entry, U_8 * buffer, U_32 bufferSize)
 {
   PORT_ACCESS_FROM_PORT (portLib);
+#if defined(HY_NO_THR)
+  THREAD_ACCESS_FROM_PORT(portLib);
+#endif /* HY_NO_THR */
 
   I_32 result;
   U_8 *extraFieldBuffer;
@@ -1862,6 +1876,9 @@
                         HyZipEntry * entry, U_8 * buffer, U_32 bufferSize)
 {
   PORT_ACCESS_FROM_PORT (portLib);
+#if defined(HY_NO_THR)
+  THREAD_ACCESS_FROM_PORT(portLib);
+#endif /* HY_NO_THR */
 
   I_32 result;
   U_8 *fileCommentBuffer;
@@ -1973,6 +1990,9 @@
                  HyZipCachePool * cachePool)
 {
   PORT_ACCESS_FROM_PORT (portLib);
+#if defined(HY_NO_THR)
+  THREAD_ACCESS_FROM_PORT(portLib);
+#endif /* HY_NO_THR */
 
   IDATA fd = -1;
   I_32 result = 0;
@@ -2149,6 +2169,9 @@
                            HyZipEntry * entry, IDATA offset)
 {
   PORT_ACCESS_FROM_PORT (portLib);
+#if defined(HY_NO_THR)
+  THREAD_ACCESS_FROM_PORT(portLib);
+#endif /* HY_NO_THR */
   I_32 result;
   I_64 seekResult;
 

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/win32wrapper/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/win32wrapper/windows/makefile?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/win32wrapper/windows/makefile
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/win32wrapper/windows/makefile
Wed Mar 28 01:22:33 2007
@@ -33,6 +33,8 @@
 
 MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hypool.lib $(LIBPATH)vmi.lib 
 
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hypool.lib $(LIBPATH)vmi.lib 
+
 DLLBASE=0x13300000
 COMMENT=/comment:"Win32 Wrapper native code. (c) Copyright 2005 - 2006 The Apache Software
Foundation or its licensors, as applicable."
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/cmain.c Wed
Mar 28 01:22:33 2007
@@ -17,7 +17,13 @@
 
 #include "hycomp.h"
 #include "hyport.h"
+#ifdef HY_NO_THR
+#include "main_hlp.h"
+#endif /* HY_NO_THR */
 #include <stdlib.h>             /* for malloc for atoe and abort */
+#ifdef HY_NO_THR
+#include <stdio.h>
+#endif /* HY_NO_THR */
 
 struct haCmdlineOptions
 {
@@ -27,6 +33,9 @@
   HyPortLibrary *portLibrary;
 };
 extern UDATA VMCALL gpProtectedMain (void *arg);
+#ifdef HY_NO_THR
+extern int main_addVMDirToPath(int argc, char **argv, char **envp); 
+#endif /* HY_NO_THR */
 
 static UDATA VMCALL
 genericSignalHandler (struct HyPortLibrary *portLibrary, U_32 gpType,
@@ -80,6 +89,12 @@
   return gpProtectedMain (arg);
 }
 
+#ifdef HY_NO_THR
+typedef I_32 (PVMCALL hyport_init_library_type) (struct HyPortLibrary *portLibrary,
+		struct HyPortLibraryVersion *version, 
+		UDATA size);
+
+#endif /* HY_NO_THR */
 int
 main (int argc, char **argv, char **envp)
 {
@@ -90,13 +105,35 @@
 #if !defined(HY_NO_SIG)
   UDATA result;
 #endif /* HY_NO_SIG */
-
+#ifdef HY_NO_THR
+  UDATA portLibDescriptor;
+  hyport_init_library_type port_init_library_func;
+
+  /* determine which VM directory to use and add it to the path */
+  rc = main_addVMDirToPath(argc, argv, envp);
+  if ( 0 != rc ) {
+	  return rc;
+  }
+
+  if ( 0 != main_open_port_library(&portLibDescriptor) ) {
+	  fprintf( stderr, "failed to open hyprt library.\n" );
+	  return -1;
+  }
+  if ( 0 != main_lookup_name( portLibDescriptor, "hyport_init_library", (UDATA *)&port_init_library_func)
) {
+	  fprintf( stderr, "failed to find hyport_init_library function in hyprt library\n" );
+	  return -1;
+  }
+#endif /* HY_NO_THR */
   /* Use portlibrary version which we compiled against, and have allocated space
    * for on the stack.  This version may be different from the one in the linked DLL.
    */
   HYPORT_SET_VERSION (&portLibraryVersion, HYPORT_CAPABILITY_MASK);
   if (0 ==
+#ifndef HY_NO_THR
       hyport_init_library (&hyportLibrary, &portLibraryVersion,
+#else /* HY_NO_THR */
+	  port_init_library_func (&hyportLibrary, &portLibraryVersion,
+#endif /* HY_NO_THR */
                            sizeof (HyPortLibrary)))
     {
       options.argc = argc;

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c Wed
Mar 28 01:22:33 2007
@@ -24,6 +24,9 @@
 #include "hyexelibnls.h"        /* nls strings */
 #include "libhlp.h"             /* defaults and environment variables and string buffer functions
*/
 #include "strhelp.h"            /* for properties file parsing */
+#ifdef HY_NO_THR
+#include "main_hlp.h"           /* plaftorm specific launcher helpers */
+#endif /* HY_NO_THR */
 #include <string.h>
 #include <stdlib.h>
 
@@ -63,7 +66,11 @@
 char *VMCALL vmdll_parseCmdLine
 PROTOTYPE ((HyPortLibrary * portLibrary, UDATA lastLegalArg, char **argv));
 char *VMCALL vmdlldir_parseCmdLine
+#ifndef HY_NO_THR
 PROTOTYPE ((HyPortLibrary * portLibrary, UDATA lastLegalArg, char **argv));
+#else /* HY_NO_THR */
+PROTOTYPE ((UDATA lastLegalArg, char **argv));
+#endif /* HY_NO_THR */
 UDATA VMCALL gpProtectedMain PROTOTYPE ((struct haCmdlineOptions * args));
 IDATA convertString
 PROTOTYPE ((JNIEnv * env, HyPortLibrary * portLibrary, jclass stringClass,
@@ -73,7 +80,11 @@
 int augmentToolsArgs
 PROTOTYPE ((HyPortLibrary * portLibrary, int *argc, char ***argv));
 static IDATA addDirsToPath
+#ifndef HY_NO_THR
 PROTOTYPE ((HyPortLibrary * portLibrary, int count, char *newPathToAdd[], char **argv));
+#else /* HY_NO_THR */
+PROTOTYPE ((int count, char *newPathToAdd[], char **argv));
+#endif /* HY_NO_THR */
 int main_runJavaMain
 PROTOTYPE ((JNIEnv * env, char *mainClassName, int nameIsUTF, int java_argc,
             char **java_argv, HyPortLibrary * portLibrary));
@@ -129,8 +140,10 @@
   int genericLauncher = 0;
   char *str;
   char *knownGenericNames[] = { "java", "java.exe", "javaw.exe", NULL };
+#ifndef HY_NO_THR
   char *dirs[2];
     
+#endif /* ! HY_NO_THR */
 
   PORT_ACCESS_FROM_PORT (args->portLibrary);
 
@@ -271,7 +284,11 @@
   }
 
   /* Find the directory of the dll and set up the path */
+#ifndef HY_NO_THR
   vmdllsubdir = vmdlldir_parseCmdLine (PORTLIB, argc - 1, argv);
+#else /* HY_NO_THR */
+  vmdllsubdir = vmdlldir_parseCmdLine (argc - 1, argv);
+#endif /* HY_NO_THR */
   if (!vmdllsubdir) {
       vmdllsubdir = defaultDirName;
    }
@@ -309,6 +326,7 @@
     strcat (vmiPath, DIR_SEPERATOR_STRING);
     strcat (vmiPath, vmdll);
 
+#ifndef HY_NO_THR
     dirs[0] = newPathToAdd;
     dirs[1] = exeName;
     
@@ -320,6 +338,7 @@
         goto bail;
     }
 
+#endif /* ! HY_NO_THR */
   if (showVersion == 1)
     {
       if (!versionWritten)
@@ -566,7 +585,11 @@
  * if the argument cannot be found.
  */
 char *VMCALL
+#ifndef HY_NO_THR
 vmdlldir_parseCmdLine (HyPortLibrary * portLibrary, UDATA lastLegalArg,
+#else /* HY_NO_THR */
+vmdlldir_parseCmdLine (UDATA lastLegalArg,
+#endif /* HY_NO_THR */
                        char **argv)
 {
   UDATA i;
@@ -1003,7 +1026,11 @@
 * 
 */
 static IDATA
+#ifndef HY_NO_THR
 addDirsToPath (HyPortLibrary * portLibrary, int count, char *newPathToAdd[], char **argv)
+#else /* HY_NO_THR */
+addDirsToPath (int count, char *newPathToAdd[], char **argv)
+#endif /* HY_NO_THR */
 {
   char *oldPath = NULL;
   char *variableName = NULL;
@@ -1015,9 +1042,13 @@
   int i=0;
   int strLen;
 
+#ifndef HY_NO_THR
   PORT_ACCESS_FROM_PORT (portLibrary);
 
   hysysinfo_get_executable_name (argv[0], &exeName);
+#else /* HY_NO_THR */
+  main_get_executable_name (argv[0], &exeName);
+#endif /* HY_NO_THR */
 
 #if defined(WIN32)
   variableName = "PATH";
@@ -1066,7 +1097,11 @@
     }
   }
 
+#ifndef HY_NO_THR
   newPath = hymem_allocate_memory(strLen + 1);
+#else /* HY_NO_THR */
+  newPath = main_mem_allocate_memory(strLen + 1);
+#endif /* HY_NO_THR */
 
   strcpy (newPath, variableName);
   strcat (newPath, "=");
@@ -1456,3 +1491,67 @@
   return NULL;
 }
 
+#ifdef HY_NO_THR
+
+
+int 
+main_addVMDirToPath(int argc, char **argv, char **envp) 
+{
+  char *vmdllsubdir;
+  char *newPathToAdd = NULL;
+  char *propertiesFileName = NULL;
+  char *exeName = NULL;
+  char *exeBaseName;
+  char *endPathPtr;
+  char defaultDirName[] = "default";
+  int rc = -1;
+  char *dirs[2];
+	    
+  /* Find out name of the executable we are running as */
+  main_get_executable_name (argv[0], &exeName);
+
+  /* Pick out the end of the exe path, and start of the basename */
+  exeBaseName = strrchr(exeName, HY_PATH_SLASH);
+  if (exeBaseName == NULL) {
+    endPathPtr = exeBaseName = exeName;
+  } else {
+    exeBaseName += 1;
+    endPathPtr = exeBaseName;
+  }
+
+  /* Find the directory of the dll and set up the path */
+  vmdllsubdir = vmdlldir_parseCmdLine (argc - 1, argv);
+  if (!vmdllsubdir) {
+      vmdllsubdir = defaultDirName;
+   }
+
+  /* jvm dlls are located in a subdirectory off of jre/bin */
+  /* setup path to dll named in -vm argument                      */
+  endPathPtr[0] = '\0';
+
+  newPathToAdd = main_mem_allocate_memory (strlen (exeName) + strlen (vmdllsubdir) + 1);
+	    
+  if (newPathToAdd == NULL) {
+     goto bail;
+   }
+	        
+  strcpy (newPathToAdd, exeName);
+  strcat (newPathToAdd, vmdllsubdir);
+
+  dirs[0] = newPathToAdd;
+  dirs[1] = exeName;
+	    
+  rc = addDirsToPath(2, dirs, argv);
+	    
+bail:
+  if (exeName) {
+    main_mem_free_memory (exeName);
+  }
+
+  if (newPathToAdd) {
+    main_mem_free_memory (newPathToAdd);
+  }
+  // error code should be equal to 1 because of compatibility
+  return rc == 0 ? 0 : 1;
+}
+#endif /* HY_NO_THR */

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/unix/makefile?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/unix/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/unix/makefile Wed
Mar 28 01:22:33 2007
@@ -22,7 +22,11 @@
 BUILDFILES = $(SHAREDSUB)main.o $(SHAREDSUB)cmain.o \
 	$(SHAREDSUB)launcher_copyright.o $(SHAREDSUB)strbuf.o \
 	$(SHAREDSUB)libhlp.o  
+ifeq ($(HY_NO_THR),false)
 MDLLIBFILES += $(DLLPATH)libhyprt.so
+else
+BUILDFILES += main_hlp.o
+endif
 EXENAME = $(EXEPATH)java
 
 include $(HY_HDK)/build/make/rules.mk

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javae
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javae?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javae
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javae
Wed Mar 28 01:22:33 2007
@@ -24,9 +24,14 @@
 
 BUILDFILES = $(SHAREDSUB)launcher_copyright.obj $(SHAREDSUB)cmain.obj \
         $(SHAREDSUB)main.obj $(SHAREDSUB)strbuf.obj $(SHAREDSUB)libhlp.obj
+!IF "$(HY_NO_THR)" == "false"
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hyprt.lib
+!ELSE
+BUILDFILES = $(BUILDFILES) main_hlp.obj
+!ENDIF
+
 VIRTFILES = java.res
 EXEFLAGS=$(conlflags) -subsystem:console
 EXEDLLFILES=$(conlibsdll)
-MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hyprt.lib
 
 !include <$(HY_HDK)\build\make\rules.mak>

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javaw
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javaw?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javaw
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/makefile.javaw
Wed Mar 28 01:22:33 2007
@@ -20,11 +20,17 @@
 !include <$(HY_HDK)\build\make\defines.mak>
 
 EXENAME=$(EXEPATH)javaw.exe
+HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB)
+
 BUILDFILES = $(SHAREDSUB)launcher_copyright.obj $(SHAREDSUB)main.obj \
         winmain.obj $(SHAREDSUB)strbuf.obj $(SHAREDSUB)libhlp.obj
+!IF "$(HY_NO_THR)" == "false"
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hyprt.lib
+!ELSE
+BUILDFILES = $(BUILDFILES) main_hlp.obj
+!ENDIF
 VIRTFILES = javaw.res
 EXEFLAGS=$(guilflags) -subsystem:windows
 EXEDLLFILES=$(guilibsdll)
-MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hyprt.lib
 
 !include <$(HY_HDK)\build\make\rules.mak>

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/winmain.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/winmain.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/winmain.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/windows/winmain.c
Wed Mar 28 01:22:33 2007
@@ -19,16 +19,30 @@
 #include "jni.h"
 #include "hyport.h"
 //#include "libhlp.h"
+#ifdef HY_NO_THR
+#include "main_hlp.h"
+#endif /* HY_NO_THR */
 
 /* external prototypes */
 UDATA VMCALL gpProtectedMain PROTOTYPE ((void *arg));
+#ifdef HY_NO_THR
+extern int main_addVMDirToPath PROTOTYPE((int argc, char **argv, char **envp));
+#endif /* HY_NO_THR */
 
 char **getArgvCmdLine
+#ifndef HY_NO_THR
 PROTOTYPE ((HyPortLibrary * portLibrary, LPTSTR buffer, int *finalArgc));
+#else /* HY_NO_THR */
+PROTOTYPE ((LPTSTR buffer, int *finalArgc));
+#endif /* HY_NO_THR */
 int WINAPI WinMain
 PROTOTYPE ((HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
       int nShowCmd));
+#ifndef HY_NO_THR
 void freeArgvCmdLine PROTOTYPE ((HyPortLibrary * portLibrary, char **argv));
+#else /* HY_NO_THR */
+void freeArgvCmdLine PROTOTYPE ((char **argv));
+#endif /* HY_NO_THR */
 
 struct haCmdlineOptions
 {
@@ -38,6 +52,13 @@
   HyPortLibrary *portLibrary;
 };
 
+#ifdef HY_NO_THR
+typedef I_32 (PVMCALL hyport_init_library_type) (struct HyPortLibrary *portLibrary,
+		struct HyPortLibraryVersion *version, 
+		UDATA size);
+
+
+#endif /* HY_NO_THR */
 int WINAPI
 WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
    int nShowCmd)
@@ -47,12 +68,41 @@
   HyPortLibraryVersion portLibraryVersion;
   struct haCmdlineOptions options;
   char **argv;
+#ifdef HY_NO_THR
+  UDATA portLibDescriptor;
+  hyport_init_library_type port_init_library_func;
+  
+  argv = getArgvCmdLine (GetCommandLine (), &argc);
+  if (argv == NULL) {
+	  rc = -1;
+	  goto cleanup;
+  }
+
+  /* determine which VM directory to use and add it to the path */
+  rc = main_addVMDirToPath(argc, argv, NULL);
+  if ( rc != 0 ) {
+	  goto cleanup;
+  }
+
+  if ( 0 != main_open_port_library(&portLibDescriptor) ) {
+	  fprintf( stderr, "failed to open hyprt library.\n" );
+	  rc = -1;
+	  goto cleanup;
+  }
+
+  if ( 0 != main_lookup_name( portLibDescriptor, "hyport_init_library", (UDATA *)&port_init_library_func)
) {
+	  fprintf( stderr, "failed to find hyport_init_library function in hyprt library\n" );
+	  rc = -1;
+	  goto cleanup;
+  }
+#endif /* HY_NO_THR */
 
   /* Use portlibrary version which we compiled against, and have allocated space
    * for on the stack.  This version may be different from the one in the linked DLL.
    */
 
   HYPORT_SET_VERSION (&portLibraryVersion, HYPORT_CAPABILITY_MASK);
+#ifndef HY_NO_THR
   rc =
     hyport_init_library (&hyportLibrary, &portLibraryVersion,
        sizeof (HyPortLibrary));
@@ -78,6 +128,25 @@
     {
       return -1;
     }
+#else /* HY_NO_THR */
+  rc = port_init_library_func (&hyportLibrary, &portLibraryVersion, sizeof (HyPortLibrary));
+  if (0 != rc) {
+	  goto cleanup;
+  }
+	  
+  options.argc = argc;
+  options.argv = argv;
+  options.envp = NULL;
+  options.portLibrary = &hyportLibrary;
+  rc = hyportLibrary.gp_protect (&hyportLibrary, gpProtectedMain, &options);
+  hyportLibrary.port_shutdown_library (&hyportLibrary);
+
+cleanup:
+	if (argv) {
+		freeArgvCmdLine(argv);
+	}
+	return rc;
+#endif /* HY_NO_THR */
 }
 
 /*
@@ -87,7 +156,11 @@
  *  also converts the string to ASCII.
  */
 char **
+#ifndef HY_NO_THR
 getArgvCmdLine (HyPortLibrary * portLibrary, LPTSTR buffer, int *finalArgc)
+#else /* HY_NO_THR */
+getArgvCmdLine (LPTSTR buffer, int *finalArgc)
+#endif /* HY_NO_THR */
 {
 
 #define QUOTE_CHAR  34
@@ -95,7 +168,9 @@
   int argc = 0, currentArg, i, asciiLen;
   char *asciiCmdLine;
   char **argv;
+#ifndef HY_NO_THR
   PORT_ACCESS_FROM_PORT (portLibrary);
+#endif /* ! HY_NO_THR */
 
   asciiCmdLine = buffer;
 
@@ -109,7 +184,11 @@
     }
 
   /* allocate the buffer for the args */
+#ifndef HY_NO_THR
   argv = hymem_allocate_memory (argc * sizeof (char *));
+#else /* HY_NO_THR */
+  argv = main_mem_allocate_memory (argc * sizeof (char *));
+#endif /* HY_NO_THR */
   if (!argv)
     return NULL;
 
@@ -168,9 +247,17 @@
 
 #undef QUOTE_CHAR
 void
+#ifndef HY_NO_THR
 freeArgvCmdLine (HyPortLibrary * portLibrary, char **argv)
+#else /* HY_NO_THR */
+freeArgvCmdLine (char **argv)
+#endif /* HY_NO_THR */
 {
+#ifndef HY_NO_THR
   PORT_ACCESS_FROM_PORT (portLibrary);
 
   hymem_free_memory (argv);
+#else /* HY_NO_THR */
+  main_mem_free_memory (argv);
+#endif /* HY_NO_THR */
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c Wed Mar
28 01:22:33 2007
@@ -77,6 +77,9 @@
  */
 void JNICALL HyVMLSFreeKeys(JNIEnv * env, UDATA * pInitCount, ...)
 {
+#if defined(HY_NO_THR)
+	THREAD_ACCESS_FROM_ENV(env);
+#endif /* HY_NO_THR */
 	va_list args;
 	HyVMLSTable* vmls = GLOBAL_DATA(VMLSTable);
 
@@ -122,6 +125,9 @@
  */
 UDATA JNICALL HyVMLSAllocKeys(JNIEnv * env, UDATA * pInitCount, ...)
 {
+#if defined(HY_NO_THR)
+	THREAD_ACCESS_FROM_ENV(env);
+#endif /* HY_NO_THR */
 	va_list args;
 	HyVMLSTable *vmls = GLOBAL_DATA(VMLSTable);
 
@@ -259,6 +265,9 @@
  */	
 void initializeVMLocalStorage(JavaVM * vm)
 {
+#if defined(HY_NO_THR)
+	THREAD_ACCESS_FROM_JAVAVM(vm);
+#endif /* HY_NO_THR */
 	HyVMLSTable* vmls = GLOBAL_DATA(VMLSTable);
 	VMLSContainer* container = NULL;
 
@@ -318,6 +327,9 @@
 	VMLSContainer* previous = NULL;
 
 	/* Reach for the VM interface */
+#if defined(HY_NO_THR)
+	THREAD_ACCESS_FROM_JAVAVM(vm);
+#endif /* HY_NO_THR */
 	PORT_ACCESS_FROM_JAVAVM(vm);
 
 	/* Obtain the global lock */

Modified: harmony/enhanced/classlib/trunk/modules/portlib/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/build.xml?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/build.xml Wed Mar 28 01:22:33 2007
@@ -32,6 +32,7 @@
         <and>
             <isset property="is.32bit" />
             <not><isset property="is.windows" /></not>
+            <equals arg1="${hy.no.thr}" arg2="false" />
         </and>
     </condition>
 
@@ -50,11 +51,11 @@
     <target name="-test-module"
             depends="-compile-native-tests,-run-native-tests" />
 
-    <target name="copy-native-includes">
+    <target name="copy-native-includes"
+            depends="-copy-thread-include,-copy-thread-stub-include" >
         <copy todir="${hy.hdk}/include" overwrite="yes">
             <fileset dir="${hy.portlib.src.main.native}/include/shared">
                 <include name="hyport.h" />
-                <include name="hythread.h" />
                 <include name="hycomp.h" />
                 <include name="hyporterror.h" />
                 <include name="hypool.h" />
@@ -69,9 +70,25 @@
         </copy>
     </target>
 
+    <target name="-copy-thread-include" unless="hy.skip.thr" >
+        <copy todir="${hy.hdk}/include" overwrite="yes">
+            <fileset dir="${hy.portlib.src.main.native}/include/shared">
+                <include name="hythread.h" />
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="-copy-thread-stub-include" if="hy.skip.thr" >
+        <copy todir="${hy.hdk}/include" overwrite="yes">
+            <fileset dir="${hy.portlib.src.main.native}/thrstub/shared">
+                <include name="hythread.h" />
+            </fileset>
+        </copy>
+    </target>
+
     <!-- Build the portlib native components -->
     <target name="build-native"
-        depends="-build-native,-build-native-sig,-build-native-thread,-build-native-port"
/>
+        depends="-build-native,-build-native-sig,-build-native-thread,-build-native-thrstub,-build-native-port"
/>
     <target name="-build-native">
        <!-- Build common lib -->
         <make dir="${hy.portlib.src.main.native}/common/${hy.os.family}" />
@@ -92,7 +109,7 @@
         </copy>
     </target>
 
-    <target name="-build-native-thread">
+    <target name="-build-native-thread" unless="hy.skip.thr">
         <!-- Build thread dll -->
         <make dir="${hy.portlib.src.main.native}/thread/${hy.os.family}" />
 
@@ -104,6 +121,18 @@
         </copy>
     </target>
 
+    <target name="-build-native-thrstub" if="hy.skip.thr">
+        <!-- Build thread dll -->
+        <make dir="${hy.portlib.src.main.native}/thrstub/${hy.os.family}" />
+
+        <copy todir="${hy.hdk}/lib" overwrite="yes">
+            <fileset dir="${hy.portlib.src.main.native}/thrstub">
+                <include name="*${shlib.suffix}*" />
+                <exclude name="*${manifest.suffix}"/>
+            </fileset>
+        </copy>
+    </target>
+
     <target name="-build-native-port">
         <!-- Build port dll -->
         <make dir="${hy.portlib.src.main.native}/port/${hy.os.family}" />
@@ -118,15 +147,13 @@
     </target>
 
     <!-- Clean natives -->
-    <target name="clean-native" depends="-clean-native-sig,-clean-native-tests">
+    <target name="clean-native" depends="-clean-native-tests">
+        <make dir="${hy.portlib.src.main.native}/sig/${hy.os.family}" target="clean" />
         <make dir="${hy.portlib.src.main.native}/thread/${hy.os.family}" target="clean"
/>
+        <make dir="${hy.portlib.src.main.native}/thrstub/${hy.os.family}" target="clean"
/>
         <make dir="${hy.portlib.src.main.native}/port/${hy.os.family}" target="clean"
/>
         <make dir="${hy.portlib.src.main.native}/common/${hy.os.family}" target="clean"
/>
         <make dir="${hy.portlib.src.main.native}/pool/${hy.os.family}" target="clean"
/>
-    </target>
-
-    <target name="-clean-native-sig" unless="hy.skip.sig">
-        <make dir="${hy.portlib.src.main.native}/sig/${hy.os.family}" target="clean" />
     </target>
 
     <target name="clean" depends="clean-native-includes" />

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h
Wed Mar 28 01:22:33 2007
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #endif
 
+struct HyPortLibrary;
 /**
  * @name Port library access
  * @anchor PortAccess
@@ -58,8 +59,6 @@
 #define PORT_ACCESS_FROM_VMI(vmi) HyPortLibrary *privatePortLibrary = (*vmi)->GetPortLibrary(vmi)
 #define PORT_ACCESS_FROM_PORT(portLibrary) HyPortLibrary *privatePortLibrary = (portLibrary)
 
-/** @} */
-
 #define HY_STR_(x) #x
 #define HY_STR(x) HY_STR_(x)
 #define HY_GET_CALLSITE() __FILE__ ":" HY_STR(__LINE__)
@@ -1001,7 +1000,10 @@
   /** see @ref hyfile.c::hybuf_write_text "hybuf_write_text"*/
   char *(PVMCALL buf_write_text) (struct HyPortLibrary * portLibrary,
                                  const char *buf, IDATA nbytes);
-
+#if defined(HY_NO_THR)
+  /** see @ref hyport.c::hyport_get_thread_library "hyport_get_thread_library" */
+  HyThreadLibrary * (PVMCALL port_get_thread_library) (struct HyPortLibrary * portLibrary);
+#endif /* HY_NO_THR */
   char _hypadding039C[4];       /* 4 bytes of automatic padding */
 } HyPortLibrary;
 #define HYPORT_SL_FOUND  0
@@ -1031,7 +1033,11 @@
 #define HYPORT_CTLDATA_TRACE_STOP  "TRACE_STOP"
 #define HYPORT_CTLDATA_SHMEM_GROUP_PERM  "SHMEM_GROUP_PERM"
 #define HYPORT_MAJOR_VERSION_NUMBER  4
+#if defined(HY_NO_THR)
+#define HYPORT_MINOR_VERSION_NUMBER  1
+#else
 #define HYPORT_MINOR_VERSION_NUMBER  0
+#endif
 #define HYPORT_CAPABILITY_BASE  0
 #define HYPORT_CAPABILITY_STANDARD  1
 #define HYPORT_CAPABILITY_FILESYSTEM  2
@@ -1109,6 +1115,18 @@
 #define HYPORT_SIG_GPR_AMD64_R13  -29
 #define HYPORT_SIG_GPR_AMD64_R14  -30
 #define HYPORT_SIG_GPR_AMD64_R15  -31
+#define HYPORT_SIG_CONTROL_POWERPC_LR  -32
+#define HYPORT_SIG_CONTROL_POWERPC_MSR  -33
+#define HYPORT_SIG_CONTROL_POWERPC_CTR  -34
+#define HYPORT_SIG_CONTROL_POWERPC_CR  -35
+#define HYPORT_SIG_CONTROL_POWERPC_FPSCR  -36
+#define HYPORT_SIG_CONTROL_POWERPC_XER  -37
+#define HYPORT_SIG_CONTROL_POWERPC_MQ  -38
+#define HYPORT_SIG_CONTROL_POWERPC_DAR  -39
+#define HYPORT_SIG_CONTROL_POWERPC_DSIR  -40
+#define HYPORT_SIG_CONTROL_MIPS_STATUS  -41
+#define HYPORT_SIG_CONTROL_MIPS_FPC_CSR  -42
+#define HYPORT_SIG_CONTROL_MIPS_FPC_EIR  -43
 #define HYPORT_SIG_VALUE_UNDEFINED  1
 #define HYPORT_SIG_VALUE_STRING  2
 #define HYPORT_SIG_VALUE_ADDRESS  3
@@ -1185,6 +1203,9 @@
  * @{
  */
 #if !defined(HYPORT_LIBRARY_DEFINE)
+#if defined(HY_NO_THR)
+#define hyport_get_thread_library() privatePortLibrary->port_get_thread_library(privatePortLibrary)
+#endif
 #define hyport_shutdown_library() privatePortLibrary->port_shutdown_library(privatePortLibrary)
 #define hyport_isFunctionOverridden(param1) privatePortLibrary->port_isFunctionOverridden(privatePortLibrary,param1)
 #define hyport_tls_free() privatePortLibrary->port_tls_free(privatePortLibrary)

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c Wed
Mar 28 01:22:33 2007
@@ -83,6 +83,9 @@
 hynls_set_locale (struct HyPortLibrary *portLibrary, const char *lang,
                   const char *region, const char *variant)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
 
   HyNLSDataCache *nls = &portLibrary->portGlobals->nls_data;
 #if defined(NLS_DEBUG_TRACE)
@@ -265,6 +268,9 @@
                       U_32 module_name, U_32 message_num,
                       const char *default_string)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   HyNLSDataCache *nls = &portLibrary->portGlobals->nls_data;
   const char *message;
 #if defined(NLS_DEBUG_TRACE)
@@ -313,6 +319,9 @@
                    const int nPaths, const char *baseName,
                    const char *extension)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
 
   int i;
   char *p;
@@ -1078,6 +1087,9 @@
 I_32 VMCALL
 hynls_startup (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   HyNLSDataCache *nls = &portLibrary->portGlobals->nls_data;
 
   if (0 !=
@@ -1105,6 +1117,9 @@
 void VMCALL
 hynls_shutdown (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   HyNLSDataCache *nls = &portLibrary->portGlobals->nls_data;
   HyNLSHashEntry *entry;
   U_32 i;

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c Wed
Mar 28 01:22:33 2007
@@ -73,6 +73,10 @@
 I_32 VMCALL
 hyport_shutdown_library (struct HyPortLibrary * portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+
+#endif /* HY_NO_THR */
 #if !defined(HY_NO_SIG)
   portLibrary->sig_shutdown (portLibrary);
 #endif /* HY_NO_SIG */
@@ -202,9 +206,31 @@
 hyport_startup_library (struct HyPortLibrary * portLibrary)
 {
   I_32 rc = 0;
+#ifdef HY_NO_THR
+  HyThreadLibrary *hyThreadLibrary;
+  HyThreadLibraryVersion hyThreadLibraryVersion;
+  
+  HYTHREAD_SET_VERSION(&hyThreadLibraryVersion, HYTHREAD_CAPABILITY_MASK);
+  rc = hythread_allocate_library(&hyThreadLibraryVersion, &hyThreadLibrary);
+  if ( 0 != rc ) {
+  	 rc = HYPORT_ERROR_STARTUP_THREAD;
+  	  goto cleanup;
+    }
+
+  rc = hythread_startup_library(hyThreadLibrary);
+  if ( 0 != rc )
+    {
+  	  rc = HYPORT_ERROR_STARTUP_THREAD;
+  	  goto cleanup;
+    }
+#endif /* HY_NO_THR */
 
   /* NLS uses the thread library */
+#ifndef HY_NO_THR
   rc = hythread_attach (&portLibrary->attached_thread);
+#else /* HY_NO_THR */
+  rc = hyThreadLibrary->thread_attach (hyThreadLibrary, &portLibrary->attached_thread);
+#endif /* HY_NO_THR */
   if (0 != rc)
     {
       /* Reassign return code as hythread_attach only returns -1 on error */
@@ -220,6 +246,11 @@
       goto cleanup;
     }
 
+#ifdef HY_NO_THR
+  /* Store threadLibrary in port globals */
+  portLibrary->portGlobals->threadLibrary = hyThreadLibrary;
+  
+#endif /* HY_NO_THR */
   /* Create the tls buffers as early as possible */
   rc = hyport_tls_startup (portLibrary);
   if (0 != rc)
@@ -543,6 +574,14 @@
   return rc;
 }
 
+#ifdef HY_NO_THR
+HyThreadLibrary * VMCALL
+hyport_get_thread_library(HyPortLibrary * portLib)
+{
+  return portLib->portGlobals->threadLibrary;
+}
+
+#endif /* HY_NO_THR */
 /* Set up the NLS catalog. This must be called prior to attempting 
  * any nls_printf() calls on the port library.
  */

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hytlshelpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hytlshelpers.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hytlshelpers.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hytlshelpers.c
Wed Mar 28 01:22:33 2007
@@ -49,6 +49,9 @@
 void *VMCALL
 hyport_tls_get (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   PortlibPTBuffers_t ptBuffers;
 
   ptBuffers =
@@ -97,6 +100,9 @@
 void VMCALL
 hyport_tls_free (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   PortlibPTBuffers_t ptBuffers;
 
   MUTEX_ENTER (portLibrary->portGlobals->tls_mutex);
@@ -147,6 +153,9 @@
 I_32 VMCALL
 hyport_tls_startup (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   if (hythread_tls_alloc (&portLibrary->portGlobals->tls_key))
     {
       return HYPORT_ERROR_STARTUP_TLS_ALLOC;
@@ -172,6 +181,9 @@
 void VMCALL
 hyport_tls_shutdown (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   PortlibPTBuffers_t ptBuffers, next;
 
   /* Free all remaining buffer sets */
@@ -207,6 +219,9 @@
 void *VMCALL
 hyport_tls_peek (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   return hythread_tls_get (hythread_self (),
                            portLibrary->portGlobals->tls_key);
 }

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h
Wed Mar 28 01:22:33 2007
@@ -22,6 +22,9 @@
 #include "hyportpg.h"
 #include "hyportptb.h"
 #include "hyport.h"
+#ifdef HY_NO_THR
+#include "hythread.h"
+#endif /* HY_NO_THR */
 #include "hymutex.h"
 
 /* The following defines are used by hyshmem and hyshsem */
@@ -85,6 +88,9 @@
   hythread_tls_key_t tls_key;
   MUTEX tls_mutex;
   void *buffer_list;
+#ifdef HY_NO_THR
+  struct HyThreadLibrary *threadLibrary;
+#endif /* HY_NO_THR */
   struct HyPortPlatformGlobals platformGlobals;
 } HyPortLibraryGlobalData;
 /* HySourceHyCPUControl*/
@@ -1166,6 +1172,11 @@
   hysl_up_lookup_name
 PROTOTYPE ((struct HyPortLibrary * portLibrary, UDATA descriptor, char *name,
             UDATA * func, const char *argSignature));
+#ifdef HY_NO_THR
+extern HY_CFUNC HyThreadLibrary * VMCALL
+  hyport_get_thread_library
+PROTOTYPE ((HyPortLibrary * portLib));
+#endif /* HY_NO_THR */
 static HyPortLibrary MasterPortLibraryTable = {
   {HYPORT_MAJOR_VERSION_NUMBER, HYPORT_MINOR_VERSION_NUMBER, 0, HYPORT_CAPABILITY_MASK},
       /* portVersion */
   NULL,                         /* portGlobals */
@@ -1414,6 +1425,9 @@
   hyshmem_stat,                 /* shmem_stat */
   hysysinfo_get_processing_capacity,    /* sysinfo_get_processing_capacity */
   hybuf_write_text,            /* buf_write_text */
+#ifdef HY_NO_THR
+  hyport_get_thread_library,    /* port_get_thread_library */
+#endif /* HY_NO_THR */
 };
 #endif
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysignal.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysignal.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysignal.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysignal.c Wed
Mar 28 01:22:33 2007
@@ -222,6 +222,9 @@
                void *fn_arg, hysig_handler_fn handler, void *handler_arg,
                U_32 flags, UDATA * result)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
 
   struct HySignalHandlerRecord thisRecord;
   hythread_t thisThread;

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/makefile?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/makefile Wed
Mar 28 01:22:33 2007
@@ -36,6 +36,9 @@
 BUILDFILES += hysignal.o $(HY_PLATFORM)/hysignal_context.o
 endif
 
+ifeq ($(HY_NO_THR),true)
+MDLLIBFILES += $(LIBPATH)libhythr.so
+endif
 DLLNAME = ../libhyprt.so
 EXPNAME = HYPRT_0.1
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hysignal.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hysignal.c?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hysignal.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hysignal.c
Wed Mar 28 01:22:33 2007
@@ -18,6 +18,9 @@
 #include <windows.h>
 #include <stdlib.h>
 #include "hyport.h"
+#ifdef HY_NO_THR
+#include "portpriv.h"
+#endif /* HY_NO_THR */
 #include "hythread.h"
 #include "hysignal.h"
 
@@ -63,6 +66,9 @@
 static U_32 countInfoInCategory (struct HyPortLibrary *portLibrary,
 				 void *info, U_32 category);
 
+#ifdef HY_NO_THR
+static HyThreadLibrary * threadLibraryForConsoleCtrlHandler;
+#endif /* HY_NO_THR */
 static BOOL WINAPI consoleCtrlHandler (DWORD dwCtrlType);
 
 int structuredExceptionHandler (struct HyPortLibrary *portLibrary,
@@ -142,6 +148,9 @@
 				hysig_handler_fn handler, void *handler_arg,
 				U_32 flags)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   U_32 rc = 0;
   HyWin32AsyncHandlerRecord *cursor;
   HyWin32AsyncHandlerRecord **previousLink;
@@ -170,6 +179,10 @@
 	      /* if this is the last handler, unregister the Win32 handler function */
 	      if (asyncHandlerList == NULL)
 		{
+#ifdef HY_NO_THR
+              /* The static function consoleCtrlHandler needs a threadLibrary */
+              threadLibraryForConsoleCtrlHandler = privateThreadLibrary;
+#endif /* HY_NO_THR */
 		  SetConsoleCtrlHandler (consoleCtrlHandler, FALSE);
 		}
 	    }
@@ -206,6 +219,10 @@
 	      /* if this is the first handler, register the Win32 handler function */
 	      if (asyncHandlerList == NULL)
 		{
+#ifdef HY_NO_THR
+              /* The static function consoleCtrlHandler needs a threadLibrary */
+              threadLibraryForConsoleCtrlHandler = privateThreadLibrary;
+#endif /* HY_NO_THR */
 		  SetConsoleCtrlHandler (consoleCtrlHandler, TRUE);
 		}
 
@@ -252,6 +269,10 @@
 void VMCALL
 hysig_shutdown (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+
+#endif /* HY_NO_THR */
   hythread_monitor_t globalMonitor = hythread_global_monitor ();
 
   removeAsyncHandlers (portLibrary);
@@ -275,6 +296,9 @@
 I_32 VMCALL
 hysig_startup (struct HyPortLibrary *portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   hythread_monitor_t globalMonitor = hythread_global_monitor ();
   I_32 result = 0;
 
@@ -676,6 +700,10 @@
 static BOOL WINAPI
 consoleCtrlHandler (DWORD dwCtrlType)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_THREAD(threadLibraryForConsoleCtrlHandler);
+	
+#endif /* HY_NO_THR */
   U_32 flags;
   BOOL result = FALSE;
 
@@ -735,6 +763,9 @@
 static void
 removeAsyncHandlers (HyPortLibrary * portLibrary)
 {
+#ifdef HY_NO_THR
+  THREAD_ACCESS_FROM_PORT(portLibrary);
+#endif /* HY_NO_THR */
   /* clean up the list of async handlers */
   HyWin32AsyncHandlerRecord *cursor;
   HyWin32AsyncHandlerRecord **previousLink;
@@ -766,6 +797,10 @@
 
   if (asyncHandlerList == NULL)
     {
+#ifdef HY_NO_THR
+      /* The static function consoleCtrlHandler needs a threadLibrary */
+      threadLibraryForConsoleCtrlHandler = privateThreadLibrary;
+#endif /* HY_NO_THR */
       SetConsoleCtrlHandler (consoleCtrlHandler, FALSE);
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/makefile?view=diff&rev=523227&r1=523226&r2=523227
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/makefile
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/makefile
Wed Mar 28 01:22:33 2007
@@ -40,6 +40,7 @@
 BUILDFILES = $(BUILDFILES) hysignal.obj
 !ENDIF
 
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hythr.lib
 VIRTFILES = hyprt.res
 
 SYSLIBFILES = \



Mime
View raw message