asio2
asio2 copied to clipboard
asio2::timer timer; 如果用到windows 的DLL中 会到导致 DLL加载时卡住。
使用 process explore 查看设备堆栈显示:
ntoskrnl.exe!KeSynchronizeExecution+0x6fa6
ntoskrnl.exe!KeWaitForSingleObject+0x1460
ntoskrnl.exe!KeWaitForSingleObject+0x98f
ntoskrnl.exe!KeWaitForSingleObject+0x233
ntoskrnl.exe!IoGetIoPriorityHint+0x164d
ntoskrnl.exe!KiCheckForKernelApcDelivery+0x401
ntoskrnl.exe!KeWaitForSingleObject+0x1787
ntoskrnl.exe!KeWaitForSingleObject+0x98f
ntoskrnl.exe!KeQueryTimeIncrement+0xd14
ntoskrnl.exe!ObWaitForMultipleObjects+0x6c0
ntoskrnl.exe!setjmpex+0x8645
!NtWaitForAlertByThreadId+0x14
!RtlSleepConditionVariableSRW+0x131
!SleepConditionVariableSRW+0x29
!_Cnd_wait+0x25
!std::_Associated_state::_Wait+0x8e
!asio2::detail::iopool::start+0x26b
!asio2::detail::timer_impl_tasio2::timer,asio2::detail::template_args_timer::timer_impl_tasio2::timer,asio2::detail::template_args_timer+0x116
!`dynamic initializer for 'thisTimer''+0x10
!_initterm+0x2d
!dllmain_crt_process_attach+0x9a
!dllmain_dispatch+0x74
!RtlActivateActivationContextUnsafeFast+0x11d
!LdrGetProcedureAddressEx+0x2d7
!LdrGetProcedureAddressEx+0x6a
!RtlSwitchedVVI+0xd07
!RtlGetFullPathName_UstrEx+0x231e
!RtlDosPathNameToNtPathName_U+0xd4
!LdrLoadDll+0xe4
!LoadLibraryExW+0x162
操作是在DllMain 之前。所以DLLMain什么反应都没有。 暂时使用 session->start_timer 代替了.