mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Fix harmless warnings with mingw in timing.c
This commit is contained in:
parent
38433535e3
commit
dda5213982
3 changed files with 13 additions and 4 deletions
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue