File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737/* --- Local Variables -- */
3838/******************************************************************************/
3939
40-
41- #ifdef WOLFTPM_NO_ACTIVE_THREAD_LS
42- /* if using gHwLock and want to use a shared active TPM2_CTX between threads */
43- static TPM2_CTX * gActiveTPM ;
44- #else
45- static THREAD_LS_T TPM2_CTX * gActiveTPM ;
46- #endif
47-
4840#ifndef WOLFTPM2_NO_WOLFCRYPT
4941static volatile int gWolfCryptRefCount = 0 ;
5042#endif
5143
5244#if !defined(WOLFTPM2_NO_WOLFCRYPT ) && !defined(WOLFTPM_NO_LOCK ) && \
5345 !defined(SINGLE_THREADED )
46+ /* if a mutex lock is supported, then don't use thread local on gActiveTPM */
47+ #undef WOLFTPM_NO_ACTIVE_THREAD_LS
48+ #define WOLFTPM_NO_ACTIVE_THREAD_LS
49+
5450static wolfSSL_Mutex gHwLock WOLFSSL_MUTEX_INITIALIZER_CLAUSE (gHwLock );
5551#endif
5652
53+ #ifdef WOLFTPM_NO_ACTIVE_THREAD_LS
54+ /* if using gHwLock and want to use a shared active TPM2_CTX between threads */
55+ static TPM2_CTX * gActiveTPM ;
56+ #else
57+ static THREAD_LS_T TPM2_CTX * gActiveTPM ;
58+ #endif
59+
5760#ifdef WOLFTPM_LINUX_DEV
5861#define INTERNAL_SEND_COMMAND TPM2_LINUX_SendCommand
5962#define TPM2_INTERNAL_CLEANUP (ctx )
You can’t perform that action at this time.
0 commit comments