@@ -410,31 +410,23 @@ static void *init_stdio_handle(const char *stdio, uv_os_fd_t fd, int readable)
410410 break ;
411411 case UV_NAMED_PIPE :
412412 handle = malloc (sizeof (uv_pipe_t ));
413- JL_UV_LOCK ();
414413 if ((err = uv_pipe_init (jl_io_loop , (uv_pipe_t * )handle , 0 ))) {
415- // JL_UV_UNLOCK() equivalent is done during unwinding
416414 jl_errorf ("error initializing %s in uv_pipe_init: %s (%s %d)" , stdio , uv_strerror (err ), uv_err_name (err ), err );
417415 }
418416 if ((err = uv_pipe_open ((uv_pipe_t * )handle , fd ))) {
419- // JL_UV_UNLOCK() equivalent is done during unwinding
420417 jl_errorf ("error initializing %s in uv_pipe_open: %s (%s %d)" , stdio , uv_strerror (err ), uv_err_name (err ), err );
421418 }
422419 ((uv_pipe_t * )handle )-> data = NULL ;
423- JL_UV_UNLOCK ();
424420 break ;
425421 case UV_TCP :
426422 handle = malloc (sizeof (uv_tcp_t ));
427- JL_UV_LOCK ();
428423 if ((err = uv_tcp_init (jl_io_loop , (uv_tcp_t * )handle ))) {
429- // JL_UV_UNLOCK() equivalent is done during unwinding
430424 jl_errorf ("error initializing %s in uv_tcp_init: %s (%s %d)" , stdio , uv_strerror (err ), uv_err_name (err ), err );
431425 }
432426 if ((err = uv_tcp_open ((uv_tcp_t * )handle , (uv_os_sock_t )fd ))) {
433- // JL_UV_UNLOCK() equivalent is done during unwinding
434427 jl_errorf ("error initializing %s in uv_tcp_open: %s (%s %d)" , stdio , uv_strerror (err ), uv_err_name (err ), err );
435428 }
436429 ((uv_tcp_t * )handle )-> data = NULL ;
437- JL_UV_UNLOCK ();
438430 break ;
439431 }
440432 return handle ;
@@ -673,13 +665,6 @@ void _julia_init(JL_IMAGE_SEARCH rel)
673665 jl_init_uv ();
674666 restore_signals ();
675667
676- jl_resolve_sysimg_location (rel );
677- // loads sysimg if available, and conditionally sets jl_options.cpu_target
678- if (jl_options .image_file )
679- jl_preload_sysimg_so (jl_options .image_file );
680- if (jl_options .cpu_target == NULL )
681- jl_options .cpu_target = "native" ;
682-
683668 jl_page_size = jl_getpagesize ();
684669 uint64_t total_mem = uv_get_total_memory ();
685670 if (total_mem >= (size_t )-1 ) {
@@ -752,6 +737,13 @@ void _julia_init(JL_IMAGE_SEARCH rel)
752737
753738 jl_init_threading ();
754739
740+ jl_resolve_sysimg_location (rel );
741+ // loads sysimg if available, and conditionally sets jl_options.cpu_target
742+ if (jl_options .image_file )
743+ jl_preload_sysimg_so (jl_options .image_file );
744+ if (jl_options .cpu_target == NULL )
745+ jl_options .cpu_target = "native" ;
746+
755747 jl_gc_init ();
756748 jl_gc_enable (0 );
757749 jl_init_types ();
0 commit comments