title: debug application hung while creating a thread using beginthreadex
body: <p>I encounter a strange problem on site that our application get hung while starting.
  I get the crashdump generated by custom on site, and it shows that the main thread was stuck by beginthreadex api.
  Here's the callstack:</p>
  
  <pre><code>0:006&gt; kv
  ChildEBP 
  0161ebb8 ntdll!KiFastSystemCallRet (FPO: [0,0,0])
  0161ebbc ntdll!ZwWaitForSingleObject+0xc (FPO: [3,0,0])
  0161ebf8 ntdll!RtlpWaitOnCriticalSection+0x1a3 (FPO: [2,7,4])
  0161ec18 ntdll!RtlEnterCriticalSection+0xa8 (FPO: [1,1,0])
  0161ec4c ntdll!LdrLockLoaderLock+0x133 (FPO: [SEH])
  0161ecc8 ntdll!LdrGetDllHandleEx+0x94 (FPO: [SEH])
  0161ece4 ntdll!LdrGetDllHandle+0x18 (FPO: [4,0,0])
  0161ed30 kernel32!GetModuleHandleForUnicodeString+0x20 (FPO: [SEH])
  0161f1a8 kernel32!BasepGetModuleHandleExW+0x17f (FPO: [SEH])
  0161f1c0 kernel32!GetModuleHandleW+0x29 (FPO: [1,0,0])
  0161f1cc kernel32!GetModuleHandleA+0x2d (FPO: [1,0,0])
  0161f204 msvcr80!initptd+0x17
  0161f224 msvcr80!beginthreadex+0x56
  0161f248 ZQCommonStlp!ZQ::common::NativeThread::NativeThread+0x59 (FPO: [Non-Fpo]) (CONV: thiscall) 
  ...
  </code></pre>
  
  <p>I get nothing from this callstack but just know the main thread was stuck while creating a new thread.
  Is this a system problem?</p>