threading.h
mbedtls/config.h
stdlib.h
pthread.h
ctr_drbg.h
entropy.h
hmac_drbg.h
rsa.h
ssl_cache.h
ssl_cookie.h
ssl_ticket.h
mbedtls/check_config.h
mbedtls/config.h
threading.h
limits.h
pthread.h
stdlib.h
ctr_drbg.h
debug.h
entropy.h
hmac_drbg.h
net.h
net_sockets.h
oid.h
pk.h
psa_util.h
rsa.h
ssl.h
ssl_cache.h
ssl_ciphersuites.h
ssl_cookie.h
ssl_ticket.h
threading.h
x509.h
x509_crl.h
x509_crt.h
x509_csr.h
mbedtls_threading_mutex_t
MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE
-0x001A

The selected feature is not available.

MBEDTLS_ERR_THREADING_BAD_INPUT_DATA
-0x001C

Bad input parameters to function.

MBEDTLS_ERR_THREADING_MUTEX_ERROR
-0x001E

Locking / unlocking / free failed with error code.

struct mbedtls_threading_mutex_t typedef struct mbedtls_threading_mutex_t mbedtls_threading_mutex_t mbedtls_threading_mutex_t
void(* void(* mbedtls_mutex_init) (mbedtls_threading_mutex_t *mutex) )(mbedtls_threading_mutex_t *mutex) mbedtls_mutex_init
void(* void(* mbedtls_mutex_free) (mbedtls_threading_mutex_t *mutex) )(mbedtls_threading_mutex_t *mutex) mbedtls_mutex_free
int(* int(* mbedtls_mutex_lock) (mbedtls_threading_mutex_t *mutex) )(mbedtls_threading_mutex_t *mutex) mbedtls_mutex_lock
int(* int(* mbedtls_mutex_unlock) (mbedtls_threading_mutex_t *mutex) )(mbedtls_threading_mutex_t *mutex) mbedtls_mutex_unlock
mbedtls_threading_mutex_t mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex mbedtls_threading_readdir_mutex
mbedtls_threading_mutex_t mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex mbedtls_threading_gmtime_mutex

Threading abstraction layer.

    /*
    *CopyrightTheMbedTLSContributors
    *SPDX-License-Identifier:Apache-2.0ORGPL-2.0-or-later
    */
    #ifndefMBEDTLS_THREADING_H
    #defineMBEDTLS_THREADING_H

    #if!defined(MBEDTLS_CONFIG_FILE)
    #include"mbedtls/config.h"
    #else
    #includeMBEDTLS_CONFIG_FILE
    #endif

    #include<stdlib.h>

    #ifdef__cplusplus
    extern"C"{
    #endif

    /*MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLEisdeprecatedandshouldnotbe
    *used.*/
    #defineMBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE-0x001A

    #defineMBEDTLS_ERR_THREADING_BAD_INPUT_DATA-0x001C
    #defineMBEDTLS_ERR_THREADING_MUTEX_ERROR-0x001E

    #ifdefined(MBEDTLS_THREADING_PTHREAD)
    #include<pthread.h>
    typedefstructmbedtls_threading_mutex_t{
    pthread_mutex_tmutex;
    /*is_validis0afterafailedinitorafree,andnonzeroaftera
    *successfulinit.Thisfieldisnotconsideredpartofthepublic
    *APIofMbedTLSandmaychangewithoutnotice.*/
    charis_valid;
    }mbedtls_threading_mutex_t;
    #endif

    #ifdefined(MBEDTLS_THREADING_ALT)
    /*Youshoulddefinethembedtls_threading_mutex_ttypeinyourheader*/
    #include"threading_alt.h"

    voidmbedtls_threading_set_alt(void(*mutex_init)(mbedtls_threading_mutex_t*),
    void(*mutex_free)(mbedtls_threading_mutex_t*),
    int(*mutex_lock)(mbedtls_threading_mutex_t*),
    int(*mutex_unlock)(mbedtls_threading_mutex_t*));

    voidmbedtls_threading_free_alt(void);
    #endif/*MBEDTLS_THREADING_ALT*/

    #ifdefined(MBEDTLS_THREADING_C)
    /*
    *Thefunctionpointersformutex_init,mutex_free,mutex_andmutex_unlock
    *
    *Allthesefunctionsareexpectedtoworkortheresultwillbeundefined.
    */
    externvoid(*mbedtls_mutex_init)(mbedtls_threading_mutex_t*mutex);
    externvoid(*mbedtls_mutex_free)(mbedtls_threading_mutex_t*mutex);
    externint(*mbedtls_mutex_lock)(mbedtls_threading_mutex_t*mutex);
    externint(*mbedtls_mutex_unlock)(mbedtls_threading_mutex_t*mutex);

    /*
    *Globalmutexes
    */
    #ifdefined(MBEDTLS_FS_IO)
    externmbedtls_threading_mutex_tmbedtls_threading_readdir_mutex;
    #endif

    #ifdefined(MBEDTLS_HAVE_TIME_DATE)&&!defined(MBEDTLS_PLATFORM_GMTIME_R_ALT)
    /*Thismutexmayormaynotbeusedinthedefaultdefinitionof
    *mbedtls_platform_gmtime_r(),butinordertodeterminethat,
    *weneedtocheckPOSIXfeatures,hencemodify_POSIX_C_SOURCE.
    *Withthecurrentapproach,thisdeclarationisorphaned,lacking
    *anaccompanyingdefinition,incasembedtls_platform_gmtime_r()
    *doesn'tneedit,butthat'snotaproblem.*/
    externmbedtls_threading_mutex_tmbedtls_threading_gmtime_mutex;
    #endif/*MBEDTLS_HAVE_TIME_DATE&&!MBEDTLS_PLATFORM_GMTIME_R_ALT*/

    #endif/*MBEDTLS_THREADING_C*/

    #ifdef__cplusplus
    }
    #endif

    #endif/*threading.h*/