@@ -2997,10 +2997,12 @@ init_smp_sig_notify(void)
2997
2997
#ifdef __DARWIN__
2998
2998
2999
2999
int erts_darwin_main_thread_pipe [2 ];
3000
+ int erts_darwin_main_thread_result_pipe [2 ];
3000
3001
3001
- static void initialize_darwin_main_thread_pipe (void )
3002
+ static void initialize_darwin_main_thread_pipes (void )
3002
3003
{
3003
- if (pipe (erts_darwin_main_thread_pipe ) < 0 ) {
3004
+ if (pipe (erts_darwin_main_thread_pipe ) < 0 ||
3005
+ pipe (erts_darwin_main_thread_result_pipe ) < 0 ) {
3004
3006
erl_exit (1 ,"Fatal error initializing Darwin main thread stealing" );
3005
3007
}
3006
3008
}
@@ -3011,7 +3013,7 @@ erts_sys_main_thread(void)
3011
3013
{
3012
3014
erts_thread_disable_fpe ();
3013
3015
#ifdef __DARWIN__
3014
- initialize_darwin_main_thread_pipe ();
3016
+ initialize_darwin_main_thread_pipes ();
3015
3017
#endif
3016
3018
/* Become signal receiver thread... */
3017
3019
#ifdef ERTS_ENABLE_LOCK_CHECK
@@ -3039,7 +3041,7 @@ erts_sys_main_thread(void)
3039
3041
read (erts_darwin_main_thread_pipe [0 ],& func ,sizeof (void * (* )(void * )));
3040
3042
read (erts_darwin_main_thread_pipe [0 ],& arg , sizeof (void * ));
3041
3043
resp = (* func )(arg );
3042
- write (erts_darwin_main_thread_pipe [1 ],& resp ,sizeof (void * ));
3044
+ write (erts_darwin_main_thread_result_pipe [1 ],& resp ,sizeof (void * ));
3043
3045
}
3044
3046
#else
3045
3047
#ifdef DEBUG
0 commit comments