diff options
-rw-r--r-- | src/daemon/ntapi_dsr_init.c | 12 |
1 files changed, 12 insertions, 0 deletions
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; |