Showing with 7 additions and 3 deletions.
  1. +7 −3 src/core/thread.d
10 changes: 7 additions & 3 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -2239,9 +2239,13 @@ extern (C) void thread_suspendAll()

CONTEXT context = void;
context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL;

if( !GetThreadContext( t.m_hndl, &context ) )
throw new ThreadException( "Unable to load thread context" );

for( int i = 0; !GetThreadContext( t.m_hndl, &context ); i++ )
{
if( i > 99 )
throw new ThreadException( "Unable to load thread context" );
Thread.yield();
}

version( X86 )
{
Expand Down