Move from gmtime_r to gmtime + mutexes
* gmtime_r is not standard so -std=c99 warns about it * Anyway we need global mutexes in the threading layer, so better depend only on that, rather that global mutexes + some _r functions
This commit is contained in:
parent
ba19432d2e
commit
864108daab
3 changed files with 35 additions and 16 deletions
|
@ -112,6 +112,7 @@ void mbedtls_threading_set_alt( void (*mutex_init)( mbedtls_threading_mutex_t *
|
|||
mbedtls_mutex_unlock = mutex_unlock;
|
||||
|
||||
mbedtls_mutex_init( &mbedtls_threading_readdir_mutex );
|
||||
mbedtls_mutex_init( &mbedtls_threading_gmtime_mutex );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -120,6 +121,7 @@ void mbedtls_threading_set_alt( void (*mutex_init)( mbedtls_threading_mutex_t *
|
|||
void mbedtls_threading_free_alt( void )
|
||||
{
|
||||
mbedtls_mutex_free( &mbedtls_threading_readdir_mutex );
|
||||
mbedtls_mutex_free( &mbedtls_threading_gmtime_mutex );
|
||||
}
|
||||
#endif /* MBEDTLS_THREADING_ALT */
|
||||
|
||||
|
@ -130,5 +132,6 @@ void mbedtls_threading_free_alt( void )
|
|||
#define MUTEX_INIT
|
||||
#endif
|
||||
mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex MUTEX_INIT;
|
||||
mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex MUTEX_INIT;
|
||||
|
||||
#endif /* MBEDTLS_THREADING_C */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue