Skip to content

Commit f2e6be4

Browse files
committed
Add build option WOLFTPM_NO_ACTIVE_THREAD_LS to remove thread local on gActiveTPM.
1 parent e7aad1a commit f2e6be4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tpm2.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@
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
4045
static THREAD_LS_T TPM2_CTX* gActiveTPM;
46+
#endif
47+
4148
#ifndef WOLFTPM2_NO_WOLFCRYPT
4249
static volatile int gWolfCryptRefCount = 0;
4350
#endif

0 commit comments

Comments
 (0)