mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Fix harmless warnings with mingw in timing.c
This commit is contained in:
@ -251,9 +251,13 @@ unsigned long get_timer( struct hr_time *val, int reset )
|
||||
return( delta );
|
||||
}
|
||||
|
||||
DWORD WINAPI TimerProc( LPVOID uElapse )
|
||||
/* It's OK to use a global because alarm() is supposed to be global anyway */
|
||||
static DWORD alarmMs;
|
||||
|
||||
DWORD WINAPI TimerProc( LPVOID TimerContext )
|
||||
{
|
||||
Sleep( (DWORD) uElapse );
|
||||
((void) TimerContext);
|
||||
Sleep( alarmMs );
|
||||
alarmed = 1;
|
||||
return( TRUE );
|
||||
}
|
||||
@ -263,8 +267,8 @@ void set_alarm( int seconds )
|
||||
DWORD ThreadId;
|
||||
|
||||
alarmed = 0;
|
||||
CloseHandle( CreateThread( NULL, 0, TimerProc,
|
||||
(LPVOID) ( seconds * 1000 ), 0, &ThreadId ) );
|
||||
alarmMs = seconds * 1000;
|
||||
CloseHandle( CreateThread( NULL, 0, TimerProc, NULL, 0, &ThreadId ) );
|
||||
}
|
||||
|
||||
void m_sleep( int milliseconds )
|
||||
|
Reference in New Issue
Block a user