49#ifndef MBEDTLS_THREADING_H
50#define MBEDTLS_THREADING_H
52#if !defined(MBEDTLS_CONFIG_FILE)
55#include MBEDTLS_CONFIG_FILE
66#define MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE -0x001A
68#define MBEDTLS_ERR_THREADING_BAD_INPUT_DATA -0x001C
69#define MBEDTLS_ERR_THREADING_MUTEX_ERROR -0x001E
71#if defined(MBEDTLS_THREADING_PTHREAD)
73typedef struct mbedtls_threading_mutex_t
75 pthread_mutex_t
mutex;
80} mbedtls_threading_mutex_t;
83#if defined(MBEDTLS_THREADING_ALT)
85#include "threading_alt.h"
105void mbedtls_threading_set_alt(
void (*
mutex_init)( mbedtls_threading_mutex_t * ),
106 void (*mutex_free)( mbedtls_threading_mutex_t * ),
107 int (*
mutex_lock)( mbedtls_threading_mutex_t * ),
113void mbedtls_threading_free_alt(
void );
116#if defined(MBEDTLS_THREADING_C)
122extern void (*mbedtls_mutex_init)( mbedtls_threading_mutex_t *
mutex );
123extern void (*mbedtls_mutex_free)( mbedtls_threading_mutex_t *
mutex );
124extern int (*mbedtls_mutex_lock)( mbedtls_threading_mutex_t *
mutex );
125extern int (*mbedtls_mutex_unlock)( mbedtls_threading_mutex_t *
mutex );
130#if defined(MBEDTLS_FS_IO)
131extern mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex;
134#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_PLATFORM_GMTIME_R_ALT)
141extern mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex;
static BOOL is_valid(HIMAGELIST himl)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *