[PATCH 1/4] ntdll: Init CPU info before calling signal_init_threading.

Alexandre Julliard julliard at winehq.org
Fri Feb 19 11:26:12 CST 2021


Jacek Caban <jacek at codeweavers.com> writes:

> Signed-off-by: Jacek Caban <jacek at codeweavers.com>
> ---
>  dlls/ntdll/unix/loader.c       | 2 +-
>  dlls/ntdll/unix/system.c       | 4 ++--
>  dlls/ntdll/unix/unix_private.h | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
>
> diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
> index 8b1fd6edb7a..45ae435bbc6 100644
> --- a/dlls/ntdll/unix/loader.c
> +++ b/dlls/ntdll/unix/loader.c
> @@ -1643,13 +1643,13 @@ static void start_main_thread(void)
>      NTSTATUS status;
>      TEB *teb = virtual_alloc_first_teb();
>  
> +    init_cpu_info( teb );
>      signal_init_threading();
>      signal_alloc_thread( teb );
>      signal_init_thread( teb );
>      dbg_init();
>      startup_info_size = server_init_process();
>      virtual_map_user_shared_data();
> -    init_cpu_info();
>      init_files();
>      init_startup_info();
>      NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );

That works of course, but I'd find it cleaner to keep the thread init
before anything else.  There's no reason that the syscall dispatcher
needs to be setup at that point, we can have a signal_init_syscalls()
function called later on.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list