diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2024-02-03 04:46:58 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2024-02-03 04:48:29 +0100 |
commit | 920429fe3db975c22d2b6eff2bf2061126bb4bfc (patch) | |
tree | 515b40fa094090cde2ae5f1793732a20305da1d2 /src/include | |
parent | 9af2b9d815632fc4d28fcd4306f5599e15b237ef (diff) |
Completly disable all pthread related code in the library if `USE_GLOBAL_CONTEXT` macro is not defined.improve/disable-global-ctx-and-pthread
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_typedefs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index ebad711f1..11a8e05a2 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -25,9 +25,12 @@ E * ndpi_typedefs.h #define __NDPI_TYPEDEFS_H__ #ifndef NDPI_CFFI_PREPROCESSING +#include "ndpi_config.h" +#ifdef USE_GLOBAL_CONTEXT #define HAVE_STRUCT_TIMESPEC #include <pthread.h> #endif +#endif #include "ndpi_define.h" #ifndef NDPI_CFFI_PREPROCESSING @@ -769,8 +772,10 @@ struct ndpi_lru_cache { u_int32_t num_entries; u_int32_t ttl : 31, shared : 1; #ifndef NDPI_CFFI_PREPROCESSING +#ifdef USE_GLOBAL_CONTEXT pthread_mutex_t mutex; #endif +#endif struct ndpi_lru_cache_stats stats; struct ndpi_lru_cache_entry *entries; }; |