Mercurial > hg > graal-compiler
comparison src/os/posix/launcher/java_md.c @ 2027:aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
Summary: Updates to Visual Studio project creation and development launcher
Reviewed-by: stefank, coleenp
author | sla |
---|---|
date | Wed, 15 Dec 2010 07:11:31 -0800 |
parents | cb2d0a362639 |
children | e58d06a8037e |
comparison
equal
deleted
inserted
replaced
2025:b03e6b4c7c75 | 2027:aa6e219afbf1 |
---|---|
26 #include "java.h" | 26 #include "java.h" |
27 #include <dirent.h> | 27 #include <dirent.h> |
28 #include <dlfcn.h> | 28 #include <dlfcn.h> |
29 #include <fcntl.h> | 29 #include <fcntl.h> |
30 #include <inttypes.h> | 30 #include <inttypes.h> |
31 #include <stdint.h> | |
31 #include <stdio.h> | 32 #include <stdio.h> |
32 #include <string.h> | 33 #include <string.h> |
33 #include <stdlib.h> | 34 #include <stdlib.h> |
34 #include <limits.h> | 35 #include <limits.h> |
35 #include <sys/stat.h> | 36 #include <sys/stat.h> |
810 } | 811 } |
811 #endif | 812 #endif |
812 | 813 |
813 #ifdef GAMMA | 814 #ifdef GAMMA |
814 { | 815 { |
815 /* gamma launcher uses JAVA_HOME or ALT_JAVA_HOME environment variable to find JDK/JRE */ | 816 /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */ |
816 char* java_home_var = getenv("ALT_JAVA_HOME"); | 817 char* java_home_var = getenv("JAVA_HOME"); |
817 if (java_home_var == NULL) { | 818 if (java_home_var == NULL) { |
818 java_home_var = getenv("JAVA_HOME"); | 819 printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); |
819 } | |
820 if (java_home_var == NULL) { | |
821 printf("JAVA_HOME or ALT_JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); | |
822 return JNI_FALSE; | 820 return JNI_FALSE; |
823 } | 821 } |
824 snprintf(buf, bufsize, "%s", java_home_var); | 822 snprintf(buf, bufsize, "%s", java_home_var); |
825 } | 823 } |
826 #else | 824 #else |
1835 } | 1833 } |
1836 | 1834 |
1837 if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { | 1835 if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { |
1838 void * tmp; | 1836 void * tmp; |
1839 pthread_join(tid, &tmp); | 1837 pthread_join(tid, &tmp); |
1840 rslt = (int)tmp; | 1838 rslt = (int)(intptr_t)tmp; |
1841 } else { | 1839 } else { |
1842 /* | 1840 /* |
1843 * Continue execution in current thread if for some reason (e.g. out of | 1841 * Continue execution in current thread if for some reason (e.g. out of |
1844 * memory/LWP) a new thread can't be created. This will likely fail | 1842 * memory/LWP) a new thread can't be created. This will likely fail |
1845 * later in continuation as JNI_CreateJavaVM needs to create quite a | 1843 * later in continuation as JNI_CreateJavaVM needs to create quite a |
1853 thread_t tid; | 1851 thread_t tid; |
1854 long flags = 0; | 1852 long flags = 0; |
1855 if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { | 1853 if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { |
1856 void * tmp; | 1854 void * tmp; |
1857 thr_join(tid, NULL, &tmp); | 1855 thr_join(tid, NULL, &tmp); |
1858 rslt = (int)tmp; | 1856 rslt = (int)(intptr_t)tmp; |
1859 } else { | 1857 } else { |
1860 /* See above. Continue in current thread if thr_create() failed */ | 1858 /* See above. Continue in current thread if thr_create() failed */ |
1861 rslt = continuation(args); | 1859 rslt = continuation(args); |
1862 } | 1860 } |
1863 #endif | 1861 #endif |