File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
sdk/src/org.graalvm.launcher.native/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -707,7 +707,8 @@ int main(int argc, char *argv[]) {
707
707
* [1] https://github.com/openjdk/jdk/blob/8c1b915c7ef2b3a6e65705b91f4eb464caaec4e7/src/java.base/unix/native/libjli/java_md.c#L114
708
708
* [2] https://github.com/openjdk/jdk/blob/8c1b915c7ef2b3a6e65705b91f4eb464caaec4e7/src/java.base/macosx/native/libjli/java_md_macosx.m#L292-L325
709
709
*/
710
- bool use_new_thread = stack_size > current_thread_stack_size ();
710
+ size_t main_thread_stack_size = current_thread_stack_size ();
711
+ bool use_new_thread = stack_size > main_thread_stack_size;
711
712
#if defined (__APPLE__)
712
713
/* On macOS, always create a dedicated "main" thread for the JVM.
713
714
* The actual main thread must run the UI event loop (needed for AWT).
@@ -724,6 +725,9 @@ int main(int argc, char *argv[]) {
724
725
725
726
if (use_new_thread) {
726
727
auto threadArgs = std::make_unique<decltype (parsedArgs)>(std::move (parsedArgs));
728
+ if (debug) {
729
+ std::cout << " Creating a new thread for the JVM with stack_size=" << stack_size << " main_thread_stack_size=" << main_thread_stack_size << std::endl;
730
+ }
727
731
728
732
#ifndef _WIN32
729
733
pthread_attr_t attr;
You can’t perform that action at this time.
0 commit comments