From 5a17e11dd94c277eaa92498e80ab618c1642c166 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 12 Aug 2018 02:10:21 -0400 Subject: __ntapi_dsr_init(): overcome potential scheduling bug in recent (10.0) kernel. --- src/daemon/ntapi_dsr_init.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/daemon') diff --git a/src/daemon/ntapi_dsr_init.c b/src/daemon/ntapi_dsr_init.c index 3eae41c..539361b 100644 --- a/src/daemon/ntapi_dsr_init.c +++ b/src/daemon/ntapi_dsr_init.c @@ -126,6 +126,12 @@ int32_t __stdcall __ntapi_dsr_init(nt_daemon_params * params) NT_SYNC_NON_ALERTABLE,0))) return status; + /* overcome potential scheduling bug in recent (10.0) kernel */ + while (params->exit_code_daemon_start == NT_STATUS_PENDING) + __ntapi->zw_delay_execution( + NT_SYNC_NON_ALERTABLE, + &(nt_timeout){{0,0}}); + /* verify the port's successful creation */ if (at_locked_xadd_32(¶ms->exit_code_daemon_start,0)) return NT_STATUS_PORT_NOT_SET; @@ -150,6 +156,12 @@ int32_t __stdcall __ntapi_dsr_init(nt_daemon_params * params) NT_SYNC_NON_ALERTABLE,0))) return status; + /* overcome potential scheduling bug in recent (10.0) kernel */ + while (params->exit_code_internal_client == NT_STATUS_PENDING) + __ntapi->zw_delay_execution( + NT_SYNC_NON_ALERTABLE, + &(nt_timeout){{0,0}}); + /* verify a successful internal connection */ if (at_locked_xadd_32(¶ms->exit_code_internal_client,0)) return params->exit_code_internal_client; -- cgit v1.2.3