diff options
author | midipix <writeonce@midipix.org> | 2018-08-12 02:10:21 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-08-12 02:10:21 -0400 |
commit | 5a17e11dd94c277eaa92498e80ab618c1642c166 (patch) | |
tree | 25fd2d5cd31d6b25b738e9b25982dee1476106c3 /src/daemon | |
parent | 2766fe733d404a5ba5b1dacf82450d5aa85c9e4d (diff) | |
download | ntapi-5a17e11dd94c277eaa92498e80ab618c1642c166.tar.bz2 ntapi-5a17e11dd94c277eaa92498e80ab618c1642c166.tar.xz |
__ntapi_dsr_init(): overcome potential scheduling bug in recent (10.0) kernel.
Diffstat (limited to 'src/daemon')
-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; |