28 #if defined(POLARSSL_THREADING_C)
32 #if defined(POLARSSL_THREADING_DUMMY)
33 static int threading_mutex_init_dummy( threading_mutex_t *mutex )
39 static int threading_mutex_free_dummy( threading_mutex_t *mutex )
45 static int threading_mutex_lock_dummy( threading_mutex_t *mutex )
51 static int threading_mutex_unlock_dummy( threading_mutex_t *mutex )
63 #if defined(POLARSSL_THREADING_PTHREAD)
64 static int threading_mutex_init_pthread( threading_mutex_t *mutex )
69 if( pthread_mutex_init( mutex, NULL ) != 0 )
75 static int threading_mutex_free_pthread( threading_mutex_t *mutex )
80 if( pthread_mutex_destroy( mutex ) != 0 )
86 static int threading_mutex_lock_pthread( threading_mutex_t *mutex )
91 if( pthread_mutex_lock( mutex ) != 0 )
97 static int threading_mutex_unlock_pthread( threading_mutex_t *mutex )
102 if( pthread_mutex_unlock( mutex ) != 0 )
114 #if defined(POLARSSL_THREADING_ALT)
120 int threading_set_alt(
int (*mutex_init)( threading_mutex_t * ),
121 int (*mutex_free)( threading_mutex_t * ),
122 int (*mutex_lock)( threading_mutex_t * ),
123 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.