Fix the case of using STL without pthreads but with mutexes

On non-POSIX targets in STL mode, std::mutex is included from
mutex.h but will probably miss pthreads. Instead, other
implementations might be detected and used in mutex.h.

Therefore, adding ETL_NO_STD_MUTEX as a profile option for ETL.

Further, removing unnecessary includes from queue headers.
This commit is contained in:
Roland Reichwein 2026-04-30 19:05:54 +02:00
parent 3e4d41ca57
commit 30d04537f4
5 changed files with 11 additions and 4 deletions

View File

@ -40,7 +40,7 @@ SOFTWARE.
#elif defined(ETL_TARGET_OS_THREADX)
#include "mutex/mutex_threadx.h"
#define ETL_HAS_MUTEX 1
#elif ETL_USING_STL && ETL_USING_CPP11
#elif ETL_USING_STL && ETL_USING_CPP11 && ETL_USING_STD_MUTEX
#include "mutex/mutex_std.h"
#define ETL_HAS_MUTEX 1
#elif defined(ETL_COMPILER_ARM5) || defined(ETL_COMPILER_ARM6) || defined(ETL_COMPILER_ARM7) || defined(ETL_COMPILER_ARM8)

View File

@ -102,6 +102,16 @@ SOFTWARE.
#define ETL_NOT_USING_STL 0
#endif
//*************************************
// Helper macros for ETL_NO_STD_MUTEX.
#if defined(ETL_NO_STD_MUTEX)
#define ETL_USING_STD_MUTEX 0
#define ETL_NOT_USING_STD_MUTEX 1
#else
#define ETL_USING_STD_MUTEX 1
#define ETL_NOT_USING_STD_MUTEX 0
#endif
//*************************************
// Helper macros for ETL_STLPORT.
#if defined(ETL_STLPORT)

View File

@ -36,7 +36,6 @@ SOFTWARE.
#include "integral_limits.h"
#include "memory.h"
#include "memory_model.h"
#include "mutex.h"
#include "parameter_type.h"
#include "placement_new.h"
#include "utility.h"

View File

@ -35,7 +35,6 @@ SOFTWARE.
#include "alignment.h"
#include "integral_limits.h"
#include "memory_model.h"
#include "mutex.h"
#include "parameter_type.h"
#include "placement_new.h"
#include "utility.h"

View File

@ -36,7 +36,6 @@ SOFTWARE.
#include "integral_limits.h"
#include "memory.h"
#include "memory_model.h"
#include "mutex.h"
#include "parameter_type.h"
#include "placement_new.h"
#include "utility.h"