28 #if defined(POLARSSL_THREADING_C)
32 #if defined(POLARSSL_THREADING_PTHREAD)
33 static int threading_mutex_init_pthread( threading_mutex_t *mutex )
38 if( pthread_mutex_init( mutex, NULL ) != 0 )
44 static int threading_mutex_free_pthread( threading_mutex_t *mutex )
49 if( pthread_mutex_destroy( mutex ) != 0 )
55 static int threading_mutex_lock_pthread( threading_mutex_t *mutex )
60 if( pthread_mutex_lock( mutex ) != 0 )
66 static int threading_mutex_unlock_pthread( threading_mutex_t *mutex )
71 if( pthread_mutex_unlock( mutex ) != 0 )
83 #if defined(POLARSSL_THREADING_ALT)
84 static int threading_mutex_fail( threading_mutex_t *mutex )
95 int threading_set_alt(
int (*mutex_init)( threading_mutex_t * ),
96 int (*mutex_free)( threading_mutex_t * ),
97 int (*mutex_lock)( threading_mutex_t * ),
98 int (*mutex_unlock)( threading_mutex_t * ) )
int(* polarssl_mutex_lock)(threading_mutex_t *mutex)
Configuration options (set of defines)
Threading abstraction layer.
#define POLARSSL_ERR_THREADING_BAD_INPUT_DATA
Bad input parameters to function.
int(* polarssl_mutex_free)(threading_mutex_t *mutex)
int(* polarssl_mutex_unlock)(threading_mutex_t *mutex)
int(* polarssl_mutex_init)(threading_mutex_t *mutex)
#define POLARSSL_ERR_THREADING_MUTEX_ERROR
Locking / unlocking / free failed with error code.