mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-07 06:15:37 +00:00
Merge remote-tracking branch 'public/pr/2046' into mbedtls-2.1-proposed
This commit is contained in:
commit
2b0b9912e0
|
@ -39,6 +39,9 @@ Changes
|
||||||
in the same way as on the server side.
|
in the same way as on the server side.
|
||||||
* Change the dtls_client and dtls_server samples to work by default over
|
* Change the dtls_client and dtls_server samples to work by default over
|
||||||
IPv6 and optionally by a build option over IPv4.
|
IPv6 and optionally by a build option over IPv4.
|
||||||
|
* Change the use of Windows threading to use Microsoft Visual C++ runtime
|
||||||
|
calls, rather than Win32 API calls directly. This is necessary to avoid
|
||||||
|
conflict with C runtime usage. Found and fixed by irwir.
|
||||||
|
|
||||||
= mbed TLS 2.1.15 branch released 2018-08-31
|
= mbed TLS 2.1.15 branch released 2018-08-31
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
|
#include <process.h>
|
||||||
|
|
||||||
struct _hr_time
|
struct _hr_time
|
||||||
{
|
{
|
||||||
|
@ -261,18 +262,17 @@ unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int
|
||||||
/* It's OK to use a global because alarm() is supposed to be global anyway */
|
/* It's OK to use a global because alarm() is supposed to be global anyway */
|
||||||
static DWORD alarmMs;
|
static DWORD alarmMs;
|
||||||
|
|
||||||
static DWORD WINAPI TimerProc( LPVOID TimerContext )
|
static void TimerProc( void *TimerContext )
|
||||||
{
|
{
|
||||||
((void) TimerContext);
|
(void) TimerContext;
|
||||||
Sleep( alarmMs );
|
Sleep( alarmMs );
|
||||||
mbedtls_timing_alarmed = 1;
|
mbedtls_timing_alarmed = 1;
|
||||||
return( TRUE );
|
/* _endthread will be called implicitly on return
|
||||||
|
* That ensures execution of thread funcition's epilogue */
|
||||||
}
|
}
|
||||||
|
|
||||||
void mbedtls_set_alarm( int seconds )
|
void mbedtls_set_alarm( int seconds )
|
||||||
{
|
{
|
||||||
DWORD ThreadId;
|
|
||||||
|
|
||||||
if( seconds == 0 )
|
if( seconds == 0 )
|
||||||
{
|
{
|
||||||
/* No need to create a thread for this simple case.
|
/* No need to create a thread for this simple case.
|
||||||
|
@ -283,7 +283,7 @@ void mbedtls_set_alarm( int seconds )
|
||||||
|
|
||||||
mbedtls_timing_alarmed = 0;
|
mbedtls_timing_alarmed = 0;
|
||||||
alarmMs = seconds * 1000;
|
alarmMs = seconds * 1000;
|
||||||
CloseHandle( CreateThread( NULL, 0, TimerProc, NULL, 0, &ThreadId ) );
|
(void) _beginthread( TimerProc, 0, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* _WIN32 && !EFIX64 && !EFI32 */
|
#else /* _WIN32 && !EFIX64 && !EFI32 */
|
||||||
|
|
Loading…
Reference in a new issue