26 #if !defined(POLARSSL_CONFIG_FILE)
29 #include POLARSSL_CONFIG_FILE
32 #if defined(POLARSSL_THREADING_C)
36 #if defined(POLARSSL_THREADING_PTHREAD)
37 static int threading_mutex_init_pthread( threading_mutex_t *mutex )
42 if( pthread_mutex_init( mutex, NULL ) != 0 )
48 static int threading_mutex_free_pthread( threading_mutex_t *mutex )
53 if( pthread_mutex_destroy( mutex ) != 0 )
59 static int threading_mutex_lock_pthread( threading_mutex_t *mutex )
64 if( pthread_mutex_lock( mutex ) != 0 )
70 static int threading_mutex_unlock_pthread( threading_mutex_t *mutex )
75 if( pthread_mutex_unlock( mutex ) != 0 )
87 #if defined(POLARSSL_THREADING_ALT)
88 static int threading_mutex_fail( threading_mutex_t *mutex )
99 int threading_set_alt(
int (*mutex_init)( threading_mutex_t * ),
100 int (*mutex_free)( threading_mutex_t * ),
101 int (*mutex_lock)( threading_mutex_t * ),
102 int (*mutex_unlock)( threading_mutex_t * ) )
int(* polarssl_mutex_lock)(threading_mutex_t *mutex)
Configuration options (set of defines)
int(* polarssl_mutex_unlock)(threading_mutex_t *mutex)
Threading abstraction layer.
int(* polarssl_mutex_init)(threading_mutex_t *mutex)
#define POLARSSL_ERR_THREADING_BAD_INPUT_DATA
Bad input parameters to function.
int(* polarssl_mutex_free)(threading_mutex_t *mutex)
#define POLARSSL_ERR_THREADING_MUTEX_ERROR
Locking / unlocking / free failed with error code.