Completly disable all pthread related code in the library if USE_GLOBAL_CONTEXT macro is not defined. (#2302)

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni
2024-02-03 11:53:49 +01:00
committed by GitHub
parent 9af2b9d815
commit b59994fa20
3 changed files with 15 additions and 5 deletions
+5
View File
@@ -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,7 +772,9 @@ 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;